File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/ints Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1138,12 +1138,12 @@ private BigInteger op(BigInteger a, long b) {
1138
1138
@ TypeSystemReference (PythonArithmeticTypes .class )
1139
1139
abstract static class AbsNode extends PythonUnaryBuiltinNode {
1140
1140
@ Specialization
1141
- boolean absBoolean (boolean arg ) {
1142
- return arg ;
1141
+ static int absBoolean (boolean arg ) {
1142
+ return arg ? 1 : 0 ;
1143
1143
}
1144
1144
1145
1145
@ Specialization (rewriteOn = {ArithmeticException .class , OverflowException .class })
1146
- int absInt (int arg ) throws OverflowException {
1146
+ static int absInt (int arg ) throws OverflowException {
1147
1147
int result = Math .abs (arg );
1148
1148
if (result < 0 ) {
1149
1149
throw OverflowException .INSTANCE ;
@@ -1152,13 +1152,13 @@ int absInt(int arg) throws OverflowException {
1152
1152
}
1153
1153
1154
1154
@ Specialization (replaces = "absInt" )
1155
- long absIntOvf (int arg ) {
1155
+ static long absIntOvf (int arg ) {
1156
1156
// Math.abs(Integer#MIN_VALUE) returns Integer#MIN_VALUE
1157
1157
return Math .abs ((long ) arg );
1158
1158
}
1159
1159
1160
1160
@ Specialization (rewriteOn = {ArithmeticException .class , OverflowException .class })
1161
- long absLong (long arg ) throws OverflowException {
1161
+ static long absLong (long arg ) throws OverflowException {
1162
1162
long result = Math .abs (arg );
1163
1163
if (result < 0 ) {
1164
1164
throw OverflowException .INSTANCE ;
You can’t perform that action at this time.
0 commit comments