Web lists-archives.com

Re: [Mingw-users] msvcrt printf bug

> Date: Sat, 4 Feb 2017 23:40:17 +0100 (CET)
> From: <tei.andu@xxxxxxxxxxxx>
> Eli, converting a float to string or backwards doesn't have to involve floating point operations.

I don't think conversion is possible without floating-point
operations.  But if you think I'm mistaken, please describe an
algorithm for such conversion that wouldn't use any FP operations.

> I looked at the glibc implementation (printf_fp.c) and it appears to use the GMP library.

GMP is a multiple-precision floating-point library, so it implements
those FP calculations in this case.

> Rounding in the case of truncating significant digits appears to be done on the decimal string.

Even if that's true, you need to produce the decimal string before you
round.  And that requires FP calculations.

Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
MinGW-users mailing list

This list observes the Etiquette found at 
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe