RFR: 8188044: We need Math.unsignedMultiplyHigh [v2]

Eamonn McManus emcmanus at openjdk.java.net
Thu Jul 1 22:05:01 UTC 2021


On Thu, 1 Jul 2021 18:08:22 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Please consider this proposal to add a method `unsignedMultiplyHigh(long,long)` to each of `java.lang.Math` and `java.lang.StrictMath`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8188044: Add @see links between multiplyHigh() and unsignedMultiplyHigh().

`Long` already has some unsigned arithmetic methods: `divideUnsigned`, `compareUnsigned`, `toUnsignedString`. `Math` doesn't. Would it make more sense to add the new method to `Long`? That would also avoid the quirk of having distinct methods in `Math` and `StringMath` when the numbers in involved are integers.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4644


More information about the core-libs-dev mailing list