41
41
package com .oracle .graal .python .builtins .objects .ints ;
42
42
43
43
import static com .oracle .graal .python .builtins .PythonBuiltinClassType .DeprecationWarning ;
44
- import static com .oracle .graal .python .nodes .ErrorMessages .BITWISE_INVERSION_OF_THE_UNDERLYING_INT ;
45
44
import static com .oracle .graal .python .nodes .BuiltinNames .J_INT ;
45
+ import static com .oracle .graal .python .nodes .ErrorMessages .BITWISE_INVERSION_OF_THE_UNDERLYING_INT ;
46
46
import static com .oracle .graal .python .nodes .SpecialMethodNames .J___CEIL__ ;
47
47
import static com .oracle .graal .python .nodes .SpecialMethodNames .J___FLOOR__ ;
48
48
import static com .oracle .graal .python .nodes .SpecialMethodNames .J___FORMAT__ ;
65
65
import com .oracle .graal .python .PythonLanguage ;
66
66
import com .oracle .graal .python .annotations .ArgumentClinic ;
67
67
import com .oracle .graal .python .annotations .ArgumentClinic .ClinicConversion ;
68
+ import com .oracle .graal .python .annotations .Builtin ;
68
69
import com .oracle .graal .python .annotations .Slot ;
69
70
import com .oracle .graal .python .annotations .Slot .SlotKind ;
70
71
import com .oracle .graal .python .annotations .Slot .SlotSignature ;
71
- import com .oracle .graal .python .annotations .Builtin ;
72
72
import com .oracle .graal .python .builtins .CoreFunctions ;
73
73
import com .oracle .graal .python .builtins .PythonBuiltinClassType ;
74
74
import com .oracle .graal .python .builtins .PythonBuiltins ;
@@ -813,7 +813,7 @@ static Object doIPi(int left, PInt right,
813
813
}
814
814
return Math .floorDiv (left , rightValue );
815
815
} catch (OverflowException e ) {
816
- return left < 0 == right .isNegative () ? 0 : -1 ;
816
+ return left == 0 || left < 0 == right .isNegative () ? 0 : -1 ;
817
817
}
818
818
}
819
819
@@ -831,7 +831,7 @@ static Object doLPi(long left, PInt right,
831
831
}
832
832
return Math .floorDiv (left , rightValue );
833
833
} catch (OverflowException e ) {
834
- return left < 0 == right .isNegative () ? 0 : -1 ;
834
+ return left == 0 || left < 0 == right .isNegative () ? 0 : -1 ;
835
835
}
836
836
}
837
837
0 commit comments