max double

Matthew Saltzman mjs at ces.clemson.edu
Sat Dec 16 17:18:13 UTC 2006


On Sat, 16 Dec 2006, Les wrote:

> On Fri, 2006-12-15 at 19:44 -0500, Mike - EMAIL IGNORED wrote:
>> How do I find the max double on my FC4?
>> Thanks,
>> Mike.
>>
>>
> If you are discussing the size of the double precision number, you can
> look in the Math.h.  The exact number will depend on the encoding and

These values are in float.h, not math.h.

> that is separate from the generic language specification.  Most PC's
> rely on straight binary encoding, and so would have a range of -2e48 to
> (2e48-1) with a characteristic in binary of +32767 to -3768.  The
> remaining bit sets the sign for the characteristic.

Hmm.  If the values in float.h are to be believed, doubles appear to have 
53-bit mantissas and exponents ranging from -1021 to 1024.  Long doubles 
have 64-bit mantissas and exponents ranging from -16381 to 16384.  Each 
representation also includes a sign bit for the mantissa.

Most PCs rely on IEEE-754 representation for floats.  I think the 
remaining exponent bit patterns indicate IEEE-754 states like NaN, 
INFINITY, DENORM, etc.  See http://en.wikipedia.org/wiki/IEEE_754 for an 
intro to the gory details.



>
> Regards,
> Les H
>
>
>

-- 
 		Matthew Saltzman

Clemson University Math Sciences
mjs AT clemson DOT edu
http://www.math.clemson.edu/~mjs




More information about the fedora-list mailing list