Corrected MathLib0.mod: entier was wrong on negative args
This commit is contained in:
parent
4734150614
commit
5d81b090b9
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue