fixed entier routine: did not work properly for negative args
This commit is contained in:
parent
39120c6a25
commit
69860ac7b5
@ -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…
x
Reference in New Issue
Block a user