[Oberon] Modulus on negative number

Jörg joerg.straube at iaeth.ch
Wed May 17 08:09:09 CEST 2017


Wojtek

> Am 17.05.2017 um 02:11 schrieb Skulski, Wojciech <skulski at pas.rochester.edu>:
> 
>> x DIV 0 is undefined. 
> 
> I thought than every programming language will rise a trap on division by 0, either integer or floating point. I would be surprised if Oberon did not.

Yes, it does. This is the way to flag „undefined" :-)

> The following two questions are somewhat related to this discussion.
> 
> 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".

Jörg



More information about the Oberon mailing list