Skip to content

Commit 1ecd1c0

Browse files
committed
Sonarqube: Only the sign of the result should be examined.
1 parent 6caa3f2 commit 1ecd1c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public String doD(double x) {
282282
@TruffleBoundary
283283
public String doPI(PInt x) {
284284
BigInteger value = x.getValue();
285-
return buildString(value.compareTo(BigInteger.ZERO) == -1, value.abs().toString(2));
285+
return buildString(value.compareTo(BigInteger.ZERO) < 0, value.abs().toString(2));
286286
}
287287

288288
@Specialization
@@ -336,7 +336,7 @@ public String doD(double x) {
336336
@TruffleBoundary
337337
public String doPI(PInt x) {
338338
BigInteger value = x.getValue();
339-
return buildString(value.compareTo(BigInteger.ZERO) == -1, value.abs().toString(8));
339+
return buildString(value.compareTo(BigInteger.ZERO) < 0, value.abs().toString(8));
340340
}
341341

342342
@Specialization
@@ -390,7 +390,7 @@ public String doD(double x) {
390390
@TruffleBoundary
391391
public String doPI(PInt x) {
392392
BigInteger value = x.getValue();
393-
return buildString(value.compareTo(BigInteger.ZERO) == -1, value.abs().toString(8));
393+
return buildString(value.compareTo(BigInteger.ZERO) < 0, value.abs().toString(8));
394394
}
395395

396396
@Specialization

0 commit comments

Comments
 (0)