------- Comment #18 from jakub at gcc dot gnu dot org  2006-04-21 17:22 -------
While this should now be fixed on s390{,x} (and I believe also sparc*)
with -mlong-double-128, it is still broken on powerpc{,64}.
What happens there is that gfortran returns a non-canonical number
for huge (0.0_16) (by non-canonical I mean that the difference between
upper and lower double's exponent is more than 53, in this case
106 or so, particularly upper double is 8.9884656743115795e+307 and
lower double -1.1079139325602226e+276).  libc only cares about 106 fraction
bits, so when printed into buffer, it is already printed the same as
8.9884656743115795e+307 + 0.0 alone (i.e.
8.9884656743115795386465259539451237e+307) and when read back it is read as
8.9884656743115795e+307 + 0.0.  I wonder if gfortran should either always
or at least for the couple of special numbers for the real(16) and complex(16)
kinds choose numbers that are canonical in this sense (and can thus be written
and read back the same).  E.g. when C parses IBM extended long double
constants,
they seem to be always canonical (supposedly because it always rounds to 106
fraction bits).


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amodra at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24685

Reply via email to