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
|
||||
IF x < 0.0 THEN
|
||||
i := TRUNC(-x);
|
||||
RETURN -i;
|
||||
IF FLOAT(-i) = x THEN
|
||||
RETURN -i;
|
||||
ELSE
|
||||
RETURN -i -1;
|
||||
END;
|
||||
END;
|
||||
RETURN TRUNC(x);
|
||||
END entier;
|
||||
|
|
Loading…
Reference in a new issue