comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: About the bits reserved for float variable
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: About the bits reserved for float variable [message #39506 is a reply to message #39505] Fri, 21 May 2004 07:44 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Nuno Oliveira wrote:
> I looking at the Chapter 5 of the Bulding Aplication.
>
> It says, for float variables that it's a 32 bits number in the range of
> +/-10^38 withe approximately six or seven decimal places of significance.
> What I'm missing here? How can a number 32 bit number range between -10^38
> and +10^38?

Some of the bits are used for the significand, and some of the bits are used for the
exponent. For IEEE 754 arithmetic, a single precision, 32-bit, number uses 23 bits for the
significand (plus one for the sign bit), and 8 for the exponent. With 8 bits for the
exponent, it can range from -127 to 128. 2^-127 ~ 10^-38, 2^128 ~ 10^38.

Similarly for double precision (64 bit) where the significand is 52 bits long and the
exponent 11 bits giving a range of ~10^(+/-)308.

Don't quote anything I've said above as being anything other than a 2-bit (ha ha)
explanation of a somewhat complicated topic by someone (me) who only understands the very
basics.

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: 3D plot of set of curves
Next Topic: Re: Depth visibility with Object Graphics !!!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 00:45:06 PDT 2025

Total time taken to generate the page: 0.80205 seconds