[Oberon] Size of LONGINT in ETHOberon

Dieter d.gloetzel at web.de
Tue Feb 12 10:35:42 CET 2019


I am using:

ETH PlugIn Oberon for WindowsTM / Win32 2.5 (18.12.2010)
      on Windows Vista Version 6.2.9200

According to NW (Programming in Oberon,Steps beyond Pascal and Modula) 
the size of LONGINT is +/- 2147483647

However, when I run

==================================================

MODULE powerof2;
IMPORT Out;
PROCEDURE power*;
VAR i : INTEGER; value : LONGINT;
BEGIN
i := 0; value := 1;
WHILE i < 32 DO
Out.Ln(); Out.Int(i,5); Out.Int(value,20);
INC(i); value := 2 * value;
END;
END power;
BEGIN
END powerof2.power

===================================================

I get

===================================================

  0                   1
     1                   2
     2                   4
     3                   8
     4                  16
     5                  32
     6                  64
     7                 128
     8                 256
     9                 512
    10                1024
    11                2048
    12                4096
    13                8192
    14               16384
    15               32768
    16               65536
    17              131072
    18              262144
    19              524288
    20             1048576
    21             2097152
    22             4194304
    23             8388608
    24            16777216
    25            33554432
    26            67108864
    27           134217728
    28           268435456
    29           536870912
    30          1073741824
    31 -2147483648

=============================

Has anybody got an explanation?

Thanks and bye Dieter



More information about the Oberon mailing list