integer size

Sisyphus sisyphus1 at optusnet.com.au
Thu Sep 30 13:26:41 CEST 2010


----- Original Message ----- 
From: "Ron Croonenberg" <ron.croonenberg at gmail.com>
To: "Torbjorn Granlund" <tg at gmplib.org>
Cc: <gmp-discuss at gmplib.org>
Sent: Thursday, September 30, 2010 5:13 PM
Subject: Re: integer size


> sorry about the late reaction.
>
> I checked that section,  however it says "Return the size of 'op' measured
> in number of digits in the given base"
>
> However that is not what I want to know.  I want to know if I use an
> mpz_t integer what it's actual size (in bytes) in memory is, not the
> number of digits it has in a certain base.

To get the size in bytes, take the size of 'op' measured in number of digits
in base 2, and divide by 8.

Cheers,
Rob



More information about the gmp-discuss mailing list