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

Micha Nelissen micha at neli.hopto.org
Mon Oct 29 18:36:11 CET 2007


Stephen Dickason wrote:
> In binary that is 00000001 + 0.0110011001100.... - 0.0110011001100.... because
> we hit recurring decimals a lot more in binary than decimal.  I wonder why we
> don't have a standard format (maybe we do?) that factors in the remainder as
> part of the number also?

It's possible to create a type that stores the numerator and
denominator, but then you would need to "simplify" to extract common
factors on every calculation, otherwise it would quickly run out of
range (Integer or whatever you choose). Extracting common factors takes
exponential time, so it's quite slow. The range would be quite limited
as well, it's as wide as the numerator.

Micha



More information about the fpc-pascal mailing list