Am 14.08.2013 10:11, schrieb Jonas Maebe:
On 14 Aug 2013, at 09:38, Sven Barth wrote:
- 0.5 does not always have a direct representation as a floating
point value and thus internally it might be 0.4999999 or something
like that and thus it will be rounded to 0.4 (see
alsohttp://bugs.freepascal.org/view.php?id=24374)
0.5 is one of the values that can always be represented exactly. The
fractional part of IEEE 754 floating point numbers is represented as
sums of negative powers of 2, i.e. 0.5, 0.25, etc.
It should have been "x.5" instead of "0.5" :)
What's your opinion regarding the point that the compiler does not
handle the rounding mode when "Round" is inlined for constants?
Regards,
Sven
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal