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

lib-960731 & o2c patch



> Date: Wed, 31 Jul 96 07:07:04 EDT
> From: Mike Griebling <grieblm@trt.allied.com>
> 
> I've uploaded new InOut.tar.gz, Integers.tar.gz, Longreals.tar.gz, and
> Reals.tar.gz files to cognac in /pub/ooc/incoming/lib.

The modules have been integrated into /pub/ooc/lib.

You'll need a patched o2c-1.13 to compile them.  The unpatched
compiler barfs that the decimal floating pointer representation of
MAX(REAL) (i.e. 3.40282347E+38) is too large ot be a valid REAL
number--which is correct, unless you take rounding into account.
Here's the patch for compiler/OScan.Mod:

------------------------------------------------------------------------
RCS file: RCS/OScan.Mod,v
retrieving revision 1.40
diff -u -r1.40 OScan.Mod
--- OScan.Mod   1995/12/01 07:31:02     1.40
+++ OScan.Mod   1996/07/17 16:29:57
@@ -604,6 +604,8 @@
     format : SHORTINT;
     i, d, len : INTEGER;
     start : LONGINT;
+  CONST
+    eps = 2.0282409603651670D+31;  (* equals 2^104 *)
 
   PROCEDURE GetCypher(c: CHAR; pos: INTEGER; hex: BOOLEAN): INTEGER;
     VAR
@@ -698,7 +700,9 @@
         ref[len] := nul;
         RealStr.Take (ref, realVal, format); (* convert constant *)
         IF (format = Conv.outOfRange) OR
-           (numType = numReal) & ((realVal < M.minReal) OR (realVal > M.maxReal)) THEN
+           (numType = numReal) & 
+             ((realVal < LONG(M.minReal)-eps) OR 
+              (realVal >= LONG(M.maxReal)+eps)) THEN
           Err (start, 6)
         END
       ELSE
------------------------------------------------------------------------

-- mva