Mail Archives: djgpp/1996/11/29/06:42:14
> I've got result = 112!!! not 113 as I wished, because
> the function atof() return is 1.29999... not 1.13 (and I only have
> an old i386).
> I think that problem is a bug of DJGPP Library V2.xx.
It is not a bug in library. It is a general limitation of
floating pointer numbers in base 2. The number 1.13 written in binary
notation is a periodic number and can't be expressed precicely
in types float or double.
In general, you can't trust floating numbers in being precice,
there is almost always an error.
- Raw text -