[Oberon] Fwd: Size of LONGINT in ETHOberon

Dieter d.gloetzel at web.de
Tue Feb 12 10:21:38 CET 2019


I wonder, why my request does not get published.

Regards Dieter



-------- Weitergeleitete Nachricht --------
Betreff: 	Size of LONGINT in ETHOberon
Datum: 	Mon, 11 Feb 2019 12:55:30 +0100
Von: 	Dieter <d.gloetzel at web.de>
An: 	oberon at lists.inf.ethz.ch



According to NW 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?

Thanky and bye Dieter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20190212/2e3546c7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mddggaplmcedpeif.png
Type: image/png
Size: 93203 bytes
Desc: not available
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20190212/2e3546c7/attachment-0001.png>


More information about the Oberon mailing list