gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] FpuIO bug?


From: John B Wallace Jr
Subject: [Gm2] FpuIO bug?
Date: Sat, 10 Sep 2005 16:27:08 -0400
User-agent: KMail/1.8

 The WriteLongInt procedure in the FpuIO module seems to have a problem
 with MIN(LONGINT). The code below demonstrates the problem:

MODULE FpuIOBug;

(***************************************************************************************)
 
(*     NOTE: THIS IS TEST CODE AND MAY BE INCORRECT               *)
(***************************************************************************************)

FROM StrIO IMPORT WriteLn;

FROM FpuIO IMPORT WriteLongInt;

VAR
  i,j : LONGINT;

BEGIN
  i := MAX(LONGINT);
  WriteLongInt(i,0);
  WriteLn;
  j := MIN(LONGINT);
  WriteLongInt(j,0);
  WriteLn;
  j := MIN(LONGINT) + 1;
  WriteLongInt(j,0);
  WriteLn
END FpuIOBug.


I get this output:

9223372036854775807
-'..--).0-*(+,))+(0(
-9223372036854775807


I believe the problem is in the LongIntToStr procedure at Line 397 in 
FpuIO.mod: x := -x


The gm2 version is 08 September 2005.


John Wallace




reply via email to

[Prev in Thread] Current Thread [Next in Thread]