Alex Herbert

Results 48 comments of Alex Herbert

I would be wary of this simplification without a performance test. In the Numbers class the int methods do not use long arithmetic. The long methods do not use BigInteger....

I agree. ArithmeticUtils predates JDK 8. I imagine it was ported from Math to Numbers without knowing that JDK 8 had equivalent methods. I'll do a performance test, then we...

Here are some benchmark results. JDK variants are prefixed with the class that implements the method. TLDR; the JDK is always faster for the int methods. It can be dramatically...

Just browsed the JDK 17 source code for the long methods. These use a method from Hacker's Delight (**2nd ed**). So the Hacker's Delight (presumed **1st ed**) method in ArithmeticUtils...

Added the benchmark to master. Run using: ``` cd commons-numbers-examples/examples-jmh mvn package -Pexamples-jmh java -jar target/examples-jmh.jar ArithmeticPerformance ```

I've obtained a copy of Hacker's Delight 2.0. Section 9.3 contains details of how to implement unsigned divide. The unsigned modulus is not provided but I have reworked the current...

This PR is out-of-date. The algorithm for BigFraction was rewritten since this PR was made. But IIUC this contains a method to extend beyond the `long` datatype for the numerator/denominator...

How about `potentialPrimesGTE`? The javadoc can just contain (GTE) in brackets after the `greater than or equal to` text. [GTE](https://www.acronymfinder.com/Greater-Than-or-Equal-(mathematics)-(GTE).html)

@Schamschi The merge of this has been missed. Would you care to rebase this on the current master?

I made a comment on the new package javadoc that had no reply from @Claudenw. There is some mismatch between discussing Index and index and indices, and then BitMap (the...