when is a double float nearest infinity ?

Christian Bruel chrbr@free.fr
Sat Jan 20 11:18:00 GMT 2007


using the attached example, I realize that adding any number to DBL_MAX 
gives DBL_MAX, which is perfectly compatible with the ieee 764 rounding 
default rounding mode.

However, doubling DBL_MAX gives infinity, not DBL_MAX. If this an error 
from myself or the standard interpretation, what is the rule ?

If this is standard, what is the limit for which the result is 
'infinity' instead of 'nearest' ?

Another question: is there some support in gcc or the glibc to change 
the default rounding mode to be 'infinity' ? I tried 'fesetround' 
without success.

oh, forgot to say that the example is compiled with 
i586-mandrake-linux-gnu gcc 3.4.3.

attached example compiled with gcc testinf.c -pedantic -ansi -O2

thank you for any clue,

Christian


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testinf.c
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20070120/73b3193a/attachment.c>


More information about the Gcc-help mailing list