[Oberon] real math

chris chris at gcjd.org
Mon Nov 10 13:19:11 CET 2014


On Mon, 10 Nov 2014 12:30:02 +0100, oberon at moravcik.info wrote:
> Are calculators using other algorithms?

Probably yes.

> Maybe there are digits after decimal point that are always exact and 
> after it the numbers are inexact.

No.

> I would need to know how many digits are exact for REAL and for LONGREAL?
> That would probably solve my problem because I really need to check 
> that 480 / 100 * 100 is integer number 480 again!

Sorry, you can't. The quality of the approximation is not constant 
through the range.

I suggest:
"What Every Computer Scientist Should Know About Floating-Point 
Arithmetic"
<https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html>
for more details than you probably want to know, but check out the 
chaper on
"Precision".

Greetings, Christian



More information about the Oberon mailing list