[fpc-pascal] Re: Why this evaluates on "if" wrong ?
florian at freepascal.org
Mon Oct 29 19:03:33 CET 2007
>> It's just one more funny thing one must realize,
>> when comparing real numbers with some exact
>> real constants. After this, I will try to never
>> compare doubles directly, but using tricks like
>> above. Because, in this digital world
>> 1 + 0.4 - 0.4 <> 1.
> My opinion:
> This is ludicrous.
> The end user is using a high level language and should not care whether the
> computer is digital or analog.
> For example, my calculator subtracts 0.4 just fine, and it is digital!
Yes, but how long does it take? 1ms? 10ms? People will even complain if
it takes more than 1ns on a PC in contrary and even more about the blow
of the system unit growing by the size of the fmtbcd unit ;)
More information about the fpc-pascal