Skip to content

Commit

Permalink
Fix int unary negative
Browse files Browse the repository at this point in the history
- Flip the sign, instead of forcing to negative.
- This was not caught previously as -37 was not in the test case set.
  • Loading branch information
cflee committed Mar 11, 2016
1 parent 4a82da5 commit ecfacd1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions python/common/org/python/types/Int.java
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,7 @@ public org.python.Object __ror__(org.python.Object other) {
__doc__ = ""
)
public org.python.Object __neg__() {
if (this.value < 0) {
return new org.python.types.Int(this.value);
} else {
return new org.python.types.Int(-this.value);
}
return new org.python.types.Int(-this.value);
}

@org.python.Method(
Expand Down

0 comments on commit ecfacd1

Please sign in to comment.