Mail Archives: djgpp-workers/2003/08/11/09:45:24
> In a long double, the mantissa includes the integer bit, unlike in a
> float or a double. Se we lose one bit.
The 80387 book claims that there's 64 bits of mantissa (0..63), one
bit of sign (79), and 15 bits of exponent (64..78).
> (I'd be interested in seeing the actual bit patterns of the numbers
> as shown by a debugger; I'm quite sure these bit patterns are okay.)
Linux prints this:
00 00 40 3e ff ff ff ff ff ff ff ff = 18446744073709551615.000
00 00 40 3e ff ff ff ff ff ff ff fe = 18446744073709551614.000
00 00 40 3e ff ff ff ff ff ff ff fd = 18446744073709551613.000
00 00 40 3e ff ff ff ff ff ff ff fc = 18446744073709551612.000
> Since _doprnt does some amount of math on its argument, loss of
> precision beyond the significant digits is inevitable.
If that's our excuse, it's still a bug. We should choose better
methods so that we don't lose precision.
- Raw text -