Corrected MathLib0.mod: entier was wrong on negative args

This commit is contained in:
ceriel 1989-11-27 09:37:56 +00:00
parent 4734150614
commit 5d81b090b9

View file

@ -48,7 +48,11 @@ PROCEDURE entier(x: REAL): INTEGER;
BEGIN BEGIN
IF x < 0.0 THEN IF x < 0.0 THEN
i := TRUNC(-x); i := TRUNC(-x);
RETURN -i; IF FLOAT(-i) = x THEN
RETURN -i;
ELSE
RETURN -i -1;
END;
END; END;
RETURN TRUNC(x); RETURN TRUNC(x);
END entier; END entier;