Mail Archives: djgpp/2000/01/06/11:53:43
Niklas Pettersson schrieb am 06.01.00 um 10:45 Uhr:
> I think I have found an error in DJGPP... It's illustrated by the following
> example:
This is not an error. It's a rounding problem.
The double value 0.1 cannot be represented exactly as a binary
number. It's machine representation (x) is not exact 0.1 but a little
smaller. So, ten times this value (x) is not exactly 1 but something
like 0.999999...., and when you cast this to an integer number you
will get "0".
Jens
---
| | : Jens Bischoff <j DOT bischoff AT airbus DOT dasa DOT de> |
| --< >-- : DaimlerChrysler Aerospace Airbus GmbH |
| | : Aerodynamic Data Department (EFD) |
| Dasa Airbus : D-28183 Bremen - Germany |
- Raw text -