Post by frrrstfnReading Oberon 07 report I see there are no function to convert from
LONGREAL to INTEGER and viceversa,
althougth they exist for REAL type (FLT, FLOOR).
There is also no REAL / LONGREAL type inclusion and EXP and PACK cannot be
used with LONGREALs either. Assuming that this is not just a simple
oversight, my interpretation of the Oberon-07 report is that specific
LONGREAL support in the *language* is restricted to:
Constant declarations (using the 'D' suffix)
Numeric operations (+ - / *)
That implies to me that any other functionality would have to be implemented
as a library module e.g. FPU, or additional SYSTEM extensions perhaps. Such
a module would include functions analogous to those which appear in typical
string / number conversion modules e.g. FPU.RealToLongReal,
FPU.LongRealToInt etc. to do the conversions. Typically, if the target
platform uses a floating-point coprocessor, the module might expose other
functionality available on the coprocessor.
The implementor of a system with LONGREAL support would then be responsible
for defining its behaviour to answer all of the tricky questions that the
language report conveniently avoids (e.g. what happens if LongRealToInt
overflows, what resolution is used for intermediate results of LONGREAL
operations on an 80-bit FPU, etc. etc.). I suspect this is one of those
issues that is descibed in the report's introduction as:
"What remains unsaid is mostly left so intentionally, either because it is
derivable from stated rules of the language, or *because it would
unnecessarily restrict the freedom of implementors*". (My asterisks)
Regards,
Chris Burrows
CFB Software
Astrobe: ARM Oberon-07 Development System
http://www.astrobe.com