Skip to content
Prev 29081 / 63424 Next

significant digits (PR#9682)

On Jun 3, 2008, at 2:48 PM, Duncan Murdoch wrote:

            
This has nothing to do with OS X, you get that same answer on pretty  
much all other platforms (Intel/Linux, MIPS/IRIX, Sparc/Sun, ...).  
Windows is the only one delivering the incorrect result here.
Should, yes, but Windows doesn't. In fact 10000.0 is exactly  
representable and so is 1234.5 which is the correct result that all  
except Windows get. I don't have a Windows box handy, so I can't tell  
why - but if you go through fprec this is what you get on the  
platforms I tested (log10 may vary slightly but that's irrelevant here):

x = 0.123450000000000004174439
l10 = -0.908508905732048899217546, e10 = 4
pow10 = 10000.000000000000000000000000
x*pow10 = 1234.500000000000000000000000

Cheers,
Simon