[Oberon] Negative integer literals in Oberon
chris at cfbsoftware.com
Sun Apr 26 23:27:49 CEST 2020
The only unsigned data in the 2016 definition of Oberon are BYTE values.
Ask yourself the following questions:
1. Should the following assertion be successful?
ASSERT(ABS(0FFFFFFFFH) = 0FFFFFFFFH);
If 0FFFFFFFFH is an unsigned value I would have expected the answer to be 'yes'.
2. Should the compiler accept the following statement?
i := i DIV 0FFFFFFFFH;
> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of Joerg
> Sent: Monday, 27 April 2020 5:00 AM
> To: ETH Oberon and related systems
> Subject: Re: [Oberon] Negative integer literals in Oberon
> As I wrote in an earlier email, if something is not clearly defined in
> the report I look at the compiler source to see what NW had in mind when
> he invented and/or refined an idea. Even if its not documented in the
> I mean: the idea that hex values are treated as unsigned values is more
> inline with the programmer s expectation than a compiler issueing too
> big for the value 0E0000000H.
> J rg
> > Am 26.04.2020 um 18:27 schrieb August Karlstrom <fusionfile at gmail.com>:
> > ?On 2020-04-26 16:24, J rg wrote:
> >> In Oberon-07, you can write
> >> b := 0FFFFFFFFFFFFH;
> >> i := 0FFFFFFFFFFFFH;
> >> the results are: b = 255 and i = -1.
> > I think you mean "The compiler in Project Oberon accepts..."
> > -- August
> > --
> > Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related
> > systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
More information about the Oberon