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 #39507 is a reply to message #39506] Fri, 21 May 2004 07:36 Go to previous messageGo to previous message
Chris Lee is currently offline  Chris Lee
Messages: 101
Registered: August 2003
Senior Member
In article <c8l0c4$jle$1@pegasus.fccn.pt>, "Nuno Oliveira"
<nmoliveira@fc.ul.pt> 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?
>

For an 32 bit floating point number, the first bit is the sign bit. the
next 8 bits are the exponent, the last 23 bits are the mantissa (IEEE)

The exponent has 8 bits, it can do -128 -> 128 in base 2,
2^128 = 3.4 x 10^38
2^-128 = ...10^-38

The 23 bits of the mantissa represent a number between 0 and 2 (scaled).
2^23 = 8388608, a 7 digit number

There's an equation to convert them on the IEEE website I think.

Chris.
[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: Wed Oct 08 18:10:31 PDT 2025

Total time taken to generate the page: 0.00525 seconds