Added some code to check for Nan/Inf

This commit is contained in:
ceriel 1993-02-24 15:12:49 +00:00
parent 14e756ba87
commit 5e702c5527

View file

@ -56,6 +56,12 @@ IMPLEMENTATION MODULE RealConversions;
pointpos := 0; pointpos := 0;
sign := r < 0.0D; sign := r < 0.0D;
IF sign THEN r := -r END; IF sign THEN r := -r END;
ok := TRUE;
IF NOT (r / 10.0D < r) THEN
(* assume Nan or Infinity *)
r := 0.0D;
ok := FALSE;
END;
IF r # 0.0D THEN IF r # 0.0D THEN
IF r >= 10.0D THEN IF r >= 10.0D THEN
FOR i := 1 TO 6 DO FOR i := 1 TO 6 DO
@ -81,7 +87,6 @@ IMPLEMENTATION MODULE RealConversions;
INC(pointpos); INC(pointpos);
END; END;
ind1 := 0; ind1 := 0;
ok := TRUE;
ind2 := ndigits+1; ind2 := ndigits+1;
IF NOT ecvtflag THEN IF NOT ecvtflag THEN