[Oberon] Modulus on negative number

Jan de Kruyf jan.de.kruyf at gmail.com
Wed May 17 09:50:51 CEST 2017


>„NaN“ is a special value for floating point numbers defined in IEEE 754.
In Oberon, DIV and MOD are defined on positive INTEGERs. Hence, no "NaN".

Is that defined in the hardware Joerg?
Since The language specifies for O2 : that an integer is between
MIN(INTEGER) and MAX(INTEGER).
For O7 it is not defined but there is an absolute value function in section
10.2:

ABS(x) x: numeric type | type of x | absolute value.

>Do the NaNs depend on the hardware support?

Yes.
And Texts.Mod has a routine that prints them out as "NaN"

 Texts.WriteReal* (VAR W: Writer; x: REAL; n: INTEGER);

j.


On Wed, May 17, 2017 at 8:54 AM, Skulski, Wojciech <
skulski at pas.rochester.edu> wrote:

> Joerg:
>
> >> 1. Does Oberon support NaN? If not then maybe it should?
> >> 2. Could the "undefined" become "defined as NaN" in all numerical cases
> which are now undefined?
>
> >„NaN“ is a special value for floating point numbers defined in IEEE 754.
> In Oberon, DIV and MOD are defined on positive INTEGERs. Hence, no "NaN".
>
> This is why I said "somewhat related". I understand the integer case, but
> how about the floating point?
>
> Do the NaNs depend on the hardware support? Is it wise to specify them in
> the language?
>
> Wojtek
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20170517/a60ca660/attachment.html>


More information about the Oberon mailing list