[M3devel] LONGINT, looks urgent...
Olaf Wagner
wagner at elegosoft.com
Mon Sep 28 10:32:58 CEST 2009
Quoting Tony Hosking <hosking at cs.purdue.edu>:
> It works OK for me on I386_DARWIN running with the CVS head. This
> program produces identical output for both the INTEGER and LONGINT
> values.
>
> Main.m3:
>
> MODULE Main;
> IMPORT MainC;
>
> VAR
> a, i: INTEGER;
> aa: LONGINT;
> BEGIN
> i := 0;
> FOR ii := 1L TO 1793L DO
> INC(i);
> a := i * 17 DIV 100;
> MainC.PutInt(a);
> aa := ii * 17L DIV 100L;
> MainC.PutLong(aa);
> END;
> END Main.
>
> MainC.i3:
>
> INTERFACE MainC;
>
> <*EXTERNAL*> PROCEDURE PutLong (x: LONGINT);
> <*EXTERNAL*> PROCEDURE PutInt (x: INTEGER);
>
> END MainC.
>
> MainC.C:
>
> #include <stdio.h>
>
> void PutLong (long long x) {
> printf("%d\n", x);
> }
>
> void PutInt (long x) {
> printf("%d\n", x);
> }
>
>
> On 26 Sep 2009, at 15:11, Dragiša Durić wrote:
>
>> Spent a piece of day with
>>
>> pdv := osnovica * 17L DIV 100L;
>>
>> varying osnovica from 1, over 1791, 1793... and many more. It looks like
>> LONGINT arithmetic in anything except simplest expressions is broken.
>> When turned to:
>>
>> WITH step1 = osnovica * 17L, step2 = step1 DIV 100L DO
>> pdv := step2;
>> END;
>>
>> it works...
>>
>> I have no much time ATM (doing various M3+Gtk+ tasks right now, tight on
>> delivery schedule) to check it more. My version is a bit rusty but not
>> much. If nobody makes more research, I'll - few weeks is most earliest I
>> can expect any free time.
I know that everybody else is busy, too, but we should
o open a ticket for this issue in trac
o add the test program to m3-sys/m3tests so that it is run on
all regression test platforms automatically
Any volunteers?
Olaf
--
Olaf Wagner -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96 mobile: +49 177 2345 869 fax: +49 30 23 45 86 95
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
More information about the M3devel
mailing list