kinow commented on a change in pull request #247: URL: https://github.com/apache/commons-compress/pull/247#discussion_r806130570
########## File path: src/main/java/org/apache/commons/compress/harmony/pack200/BHSDCodec.java ########## @@ -308,11 +308,8 @@ public boolean encodes(final long value) { } } else if (z < 0) { // Need to use integer overflow here to represent negatives. - if (cardinality < 4294967296L) { - z += cardinality; - } else { - z += 4294967296L; // this value is equal to (1 << 32). - } + // this value is equal to (1 << 32). Review comment: True! I have to get used to jshell. Looks like the integer overflow resets the value to `1`. But using longs works the same way as in Python. ![image](https://user-images.githubusercontent.com/304786/153925028-9d9c2d94-209c-4e6e-a136-e3f5776d68cf.png) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org