Skip to content

Commit d8ff4e5

Browse files
committed
Fixed math.fabs
1 parent a09e070 commit d8ff4e5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/MathModuleBuiltins.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,9 +1944,8 @@ public double fabs(long value) {
19441944
}
19451945

19461946
@Specialization
1947-
public PInt fabs(PInt value) {
1948-
BigInteger xabs = value.abs();
1949-
return factory().createInt(xabs);
1947+
public double fabs(PInt value) {
1948+
return Math.abs(value.doubleValueWithOverflow(getRaiseNode()));
19501949
}
19511950

19521951
@Specialization

0 commit comments

Comments
 (0)