Mail Archives: djgpp/2000/08/01/02:11:53
On Mon, 31 Jul 2000, Radical NetSurfer wrote:
> Why does the following program INCORRECTLY display
> the fractional part?
Please make a point of showing the faulty output, and please tell
exactly which part of it you think is incorrect, and why. These
things are very hard to guess.
If your problem is with the output printed for the 11th line, where it
says "Value: 1.000000", then the reason is that adding 0.1 10 times
doesn't yield 1.0 (0.1 doesn't have an exact binary representation).
Try assigning 1.0 to v directly, and see the difference.
- Raw text -