On 12.06.2018 09:01, Mattias Gaertner wrote:
Floats can represent 1.5 exactly.
Of course I do know how the binary representation of floats is done on X86 and similar architectures, and hence that same provides a bit combination that exactly defines 1.5.

That is why I did say *relying* on the exact value of a real number is erroneous. (Supposedly with the common archs, no representation of a rational a/b will be exact but those with b = 2**n).

But for an application programmer it should not be considered common knowledge, that on the architecture his program is to run on, 3/2 can be represented exactly while 2/3 can't.

That is why an application programmer should be trained not to do any assumptions which float value is to be considered  to be exact and which is not.

-Michael
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to