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

Daniël Mantione daniel.mantione at freepascal.org
Sun Oct 28 21:56:27 CET 2007



Op Sun, 28 Oct 2007, schreef Adriaan van Os:

> Daniël Mantione wrote:
> 
> > N - Natural numbers
> > Z - Integer numbers
> > Q - Rational numbers
> > R - Real numbers
> > C - Complex numbers
> > 
> > Subranges of N, Z and Q can be represented exactly in a computer.
> 
> > R and C
> > can not, we use the floating point system as approximation.
> 
> This is big nonsense.

Why? There exists no data structure that can hold any number from R or C.

> The issue is not if they can be "represented in a
> computer" but that a 10-base decimal fraction can not be represented exactly
> in a 2-base floating point format.

Indeed, and this is because the 2-base floating format is an approximation 
of R, while the datatype name "real" gives the impression that the 
datatype can hold the real numbers.

Daniël


More information about the fpc-pascal mailing list