in reply to Re:x4 rounding to nearest integer (rounding bias)
in thread rounding to nearest integer

I didn't refute that sprintf acts the way it does. I just think it's numerically wrong to "round" a number down if it's in the upper half of an intra-integer span. Half the numbers in [N,N+1) should go up, half the numbers down. Rounding everyday numbers should not be as complex as deciding when to add a leap-second the clock.

If you're a mathematician, you should know that you shouldn't leave numbers to the whims of crappy implementations in runtime libraries: calculate what you want in your own code, and understand the limitations of the hardware you're using.

--
[ e d @ h a l l e y . c c ]

  • Comment on Re: Re:x4 rounding to nearest integer (rounding bias)