[Oberon] Fighting a dragon ...
Hans Klaver
hklaver at dds.nl
Wed Jul 17 09:26:42 CEST 2024
>> (...) I am not sure what range the FLOOR function is supposed to work in.
>
> (...) the same question can be asked for FLT(n).
> The limits of FLOOR and FLT are not described in the Oberon report, as it is implementation dependent.
> Even the number of bytes of an INTEGER is not defined in Oberon; however, you can detect the implementation limit with SYSTEM.SIZE(INTEGER).
> Only BYTE is defined in Oberon to hold values from 0..255.
>
> The Verilog implementation of FLT(n) works for n < 2^24. So, for all INTEGER n > 2^24, FLT returns wrong results.
That functions like FLOOR and FLT have some upper and lower limits should not come as a surprise. But it is unfortunate that even experienced programmers have trouble finding them.
That Wirth dropped the MAX() standard function is understandable, because not all limits are known to the compiler. But I really think we need some standard way how to find out these limits. My proposal would be to put them all in a module like Limits.Mod and give them standard names.
But of course this is a different problem than the deficiencies of Texts.WriteRealFix and Texts.Scan.
Regards,
Hans
More information about the Oberon
mailing list