4141package com .oracle .graal .python .builtins .objects .ints ;
4242
4343import static com .oracle .graal .python .builtins .PythonBuiltinClassType .DeprecationWarning ;
44- import static com .oracle .graal .python .nodes .ErrorMessages .BITWISE_INVERSION_OF_THE_UNDERLYING_INT ;
4544import static com .oracle .graal .python .nodes .BuiltinNames .J_INT ;
45+ import static com .oracle .graal .python .nodes .ErrorMessages .BITWISE_INVERSION_OF_THE_UNDERLYING_INT ;
4646import static com .oracle .graal .python .nodes .SpecialMethodNames .J___CEIL__ ;
4747import static com .oracle .graal .python .nodes .SpecialMethodNames .J___FLOOR__ ;
4848import static com .oracle .graal .python .nodes .SpecialMethodNames .J___FORMAT__ ;
6565import com .oracle .graal .python .PythonLanguage ;
6666import com .oracle .graal .python .annotations .ArgumentClinic ;
6767import com .oracle .graal .python .annotations .ArgumentClinic .ClinicConversion ;
68+ import com .oracle .graal .python .annotations .Builtin ;
6869import com .oracle .graal .python .annotations .Slot ;
6970import com .oracle .graal .python .annotations .Slot .SlotKind ;
7071import com .oracle .graal .python .annotations .Slot .SlotSignature ;
71- import com .oracle .graal .python .annotations .Builtin ;
7272import com .oracle .graal .python .builtins .CoreFunctions ;
7373import com .oracle .graal .python .builtins .PythonBuiltinClassType ;
7474import com .oracle .graal .python .builtins .PythonBuiltins ;
@@ -813,7 +813,7 @@ static Object doIPi(int left, PInt right,
813813 }
814814 return Math .floorDiv (left , rightValue );
815815 } catch (OverflowException e ) {
816- return left < 0 == right .isNegative () ? 0 : -1 ;
816+ return left == 0 || left < 0 == right .isNegative () ? 0 : -1 ;
817817 }
818818 }
819819
@@ -831,7 +831,7 @@ static Object doLPi(long left, PInt right,
831831 }
832832 return Math .floorDiv (left , rightValue );
833833 } catch (OverflowException e ) {
834- return left < 0 == right .isNegative () ? 0 : -1 ;
834+ return left == 0 || left < 0 == right .isNegative () ? 0 : -1 ;
835835 }
836836 }
837837
0 commit comments