[Oberon] real math
tobject at bk.ru
Tue Nov 11 16:10:37 CET 2014
Type REAL has 7-8 significant digits according to different documentation for programming languages.
So, situation, described by Zdenek is not the case that affected by this limitation.
To see the limits, modify the Zdenek's example a bit (in BlackBox environment, for example).
This variant still returns correct result (we see that 8 digits are correct):
r := 12345678 / 100 * 100;
StdLog.Int(ENTIER(r * 1000000));
Output: 12345678000000 --- It seems, BlackBox StdLog.Int() capable of printing 64-bit integers, as this example works fine.
Then, lets add the '9' to our number... and we will get error, caused by REAL type limitations.
For 123456789 the output will be 123456788999999
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Oberon