fixed entier routine: did not work properly for negative args
This commit is contained in:
parent
55a133aa3c
commit
a49ffb7945
|
@ -48,7 +48,7 @@ PROCEDURE entier(x: REAL): INTEGER;
|
|||
BEGIN
|
||||
IF x < 0.0 THEN
|
||||
i := TRUNC(-x);
|
||||
IF FLOAT(-i) = x THEN
|
||||
IF FLOAT(i) = -x THEN
|
||||
RETURN -i;
|
||||
ELSE
|
||||
RETURN -i -1;
|
||||
|
|
Loading…
Reference in a new issue