size of float 
Author Message
 size of float

A colleague is running an application which uses some very small numbers.
What we've discovered is that these numbers end up being smaller than
10^^-38 even though that is the smallest float number according to the
documentation.  Why is that?
David Gerstman



Sat, 29 Jun 2002 03:00:00 GMT  
 size of float

Quote:

> A colleague is running an application which uses some very small numbers.
> What we've discovered is that these numbers end up being smaller than
> 10^^-38 even though that is the smallest float number according to the
> documentation.  Why is that?

When a result is small enough that it its mantissa
cannot retain a most-significant 1 and keep the
exponent in the representable range, the result
is "denormalized".  This means that high order
bits of the mantissa become 0 and it loses some
precision.  With a 24 bit mantisaa, this process
is good for another 7 orders of magnitude before
the result becomes 0.0f.

If you want to see details of FP representation,
take a look here:
  http://www.sns.ias.edu/Main/computing
 /compilers_html/common-tools
 /numerical_comp_guide/index.html
(URL should be joined into a single line.)

--
Larry Brasfield
Above opinions may be mine alone.



Sat, 29 Jun 2002 03:00:00 GMT  
 size of float

Quote:
>A colleague is running an application which uses some very small numbers.
>What we've discovered is that these numbers end up being smaller than
>10^^-38 even though that is the smallest float number according to the
>documentation.  Why is that?

Are you sure they're not double rather than float David?

Dave Lowndes
--
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Sat, 29 Jun 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Sizing a floating dialog bar

2. Size of floating pop-up menu

3. MFC reports different docking window sizes when floating win is dbl clicked!

4. float != float and floats as return types

5. enlarge a floating toolbar window's default size

6. Speed and size of double vs float (portability n performance)

7. scanf bug when retrieving a float value from a pointer to a float, in a structure

8. Help about conversion: float to alphanum and alphanum to float

9. floating point rounding or floating point printing ?

10. Converting Microsoft Floating Point type to the IEEE floating

11. differnence between float **v and float v[4][4]

12. COMPARE float to float

 

 
Powered by phpBB® Forum Software