some basic questions
Pedro Gimeno Fortea
parigalo at formauri.es
Thu Dec 21 21:37:33 CET 2006
On 12/21/2006 08:52:15 PM, Linas Vepstas wrote:
> I beleive NEXP is a signed 32-bit int, so that the largest exponent
> is 2^31, and this is independent of the number bits in the mantissa.
> Thus, the smallest and largest representable numbers are
>
> 2^{-2^31} and 2^{2^31}
Actually the exponent is a machine-dependent word and is expressed in
limbs, not in bits, so in a machine with 32-bit limbs and words
(usually they match but not always) the closest to zero and to
+infinity numbers that can be represented would be:
(2^32)^(-2^31) and (2^32)^(2^31) resp. i.e. 2^-2^36 and 2^2^36 resp.
In a machine with 64-bit limbs and words the numbers would change, the
largest being:
(2^64)^(2^63) = 2^2^69
Authoritative answers to these questions can be found in
<http://www.swox.com/gmp/manual/Float-Internals.html>.
-- Pedro Gimeno
More information about the gmp-discuss
mailing list