[fpc-pascal] Re: Why this evaluates on "if" wrong ?

L L at z505.com
Mon Oct 29 15:30:03 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!

I don't care about decimal points or any other excuses. THe fact is people
expect languages on computers to work like their calculator does or like
how grade school math worked.. simple, sensible. 

1 minus 0.4 is 0.6. We need a Type to solve this problem if there isn't 
already one using currency or the suggested units. We are using high level 
languages here, not assembly code for creeps sake.

Maybe currencies or the unit suggested by Florian solves the (IMO) ludicrous
problem of todays languages. Imagine if we could not send emails because
'digital computers don't store text, they just store numbers, so you'll have to
send your mail using numbers Sir'.


L505




More information about the fpc-pascal mailing list