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

L L at z505.com
Mon Oct 29 15:43:00 CET 2007


> The programmer definitely should care. He has to make the right choice
> in what type he chooses, so he must be aware of any 'quircks' of the type
> he is using, and that includes how things are rounded and how they are
> stored in memory. That's why there are IEEE references for this.
>
> It's his job to make sure that the end user gets something sensible on the
> screen, and that includes rounding to a usable number of digits.

Agree.

>
> The currency type calculates with a certain precision for you if you really
> don't want to be bothered with the gory details. The opposite side of the
> medal is that it's limited to 4 digits, and cannot be larger than 2^59 or
> thereabouts.
>

As long as there is some type where you can treat the language like a regular
old dumb casio calculator that was used in grade school math, then I'm happy. I
haven't done much currency work or float work with Pascal and wanted to confirm
there was at least a dumb/simple high level decimal type out there somewhere for
when you need one ;-)

L505




More information about the fpc-pascal mailing list