On Sun, 24 Dec 2023 at 13:20, <s...@apache.org> wrote: > > This is an automated email from the ASF dual-hosted git repository. > > sebb pushed a change to branch java8-simplify > in repository https://gitbox.apache.org/repos/asf/commons-numbers.git > > > at 2f60d424 Use Java 1.8 methods to simplify the ArithmeticUtils > methods remainderUnsigned and divideUnsigned (both int and long) > > This branch includes the following new commits: > > new 2f60d424 Use Java 1.8 methods to simplify the ArithmeticUtils > methods remainderUnsigned and divideUnsigned (both int and long) > > The 1 revisions listed above as "new" are entirely new to this > repository and will be described in separate emails. The revisions > listed as "add" were already present in the repository and have only > been added to this reference.
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. This is unlike those methods in my JDK 8 source code which do and are likely much slower. A quick check in JDK 21 finds this is still not an intrinsic method [1]. My only issue with the Numbers methods is they are based on the Hacker's Delight book which is not free, thus it is not easy to check the implementation against the source. Alex [1] https://chriswhocodes.com/hotspot_intrinsics_openjdk21.html --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org