[gfortran] patch for output of real values on windows systems
FX Coudert
fxcoudert@gmail.com
Sat Aug 6 08:55:00 GMT 2005
>>The provided fallback sprintf is not perfect: it prints incorrect last
>>digits (at least, not similar to those printed by GNU libc) when used
>>to output very large or very small long double values with high
>>precision (more than 15 digits). Any practical suggestion on this is
>>welcome.
>
> newlib (http://sourceware.org/newlib/) includes an implementation of
> dtoa, originally by David Gay, which is said to correctly represent
> floating point values, based on Steele and White's algorithm.
Sounds like this algorithm is what I was looking for.
> There is similar code in other free C libraries.
> There's no need to roll your own code to convert floating point values
> to printable form.
Unfortunately, I have looked at many such codes avalaible and I feel
like modyfying them such that they fit into libgfortran and do exactly
what we want (no more, no less) will be more trouble than writing
something from scratch. But the reference for this algorithm is really
welcome!
So, right now, I still wait for the patch to be reviewed (on Windows, it
makes things a lot better, even in this imperfect state) while I am
looking at further possibilities about the fallback function.
FX
More information about the Fortran
mailing list