[Bug c/67570] comparison rules fails
ka_bena at yahoo dot fr
gcc-bugzilla@gcc.gnu.org
Wed Sep 16 10:50:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67570
--- Comment #2 from BENAÏSSA <ka_bena at yahoo dot fr> ---
Thank you for your reply.
A.BENAÏSSA
Post scriptum:
Please can you confirm if you have time that the following
positive floating point values are correct.
----------------------------------
MIN_DENORMALIZED
1.401298 E-0045 for float
4.940656 E-0324 for double
3.645200 E-4951 for long double
6.475175 E-4966 for __float128
----------------------------------
HUGE_DENORMALIZED
1.175494 E-0038 for float
2.225074 E-0308 for double
6.724206 E-4932 for long double
3.362103 E-4932 for __float128
----------------------------------
MIN_NORMALIZED
1.763242 E-0038 for float
3.337611 E-0308 for double
3.362103 E-4932 for long double
5.043155 E-4932 for __float128
----------------------------------
HUGE_NORMALIZED
3.402823 E+0038 for float
1.797693 E+0308 for double
1.189731 E+4932 for long double
1.189731 E+4932 for __float128
----------------------------------
Note:
Multiplying (float)MIN_NORMALIZED * (float)MIN_NORMALIZED and
viewing this value with printf("%E..) we obtains
result = 3.109021E-076 wuich is a valid double normalized value.
The float binary representation of result is:
0 00000000 00000000000000000000000 and this is correct
because result is lower than (float)MIN_DENORMALIZED.
For coherency because:
1- (float) * (float) = (float)
2- sizeof( (float)MIN_NORMALIZED * (float)MIN_NORMALIZED) ) = 4
the result of
printf("%E\n" , (float)MIN_NORMALIZED * (float)MIN_NORMALIZED) );
I suppose must be 0.E0F.
Le Lundi 14 septembre 2015 18h52, joseph at codesourcery dot com
<gcc-bugzilla@gcc.gnu.org> a écrit :
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67570
--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot
com> ---
If I understand what you are doing correctly, this is an unnormal
representation (exponent not zero or maximal, explicit MSB of mantissa
zero). Such representations, which cannot be produced by floating-point
operations, are considered trap representations in C terms (undefined
behavior if used, no consistency expected or required). Valid
representations must have that MSB set for nonzero exponents and clear for
zero exponents.
More information about the Gcc-bugs
mailing list