RFR: 8075806: divideExact is missing in java.lang.Math
Brian Burkhalter
bpb at openjdk.java.net
Wed Jul 14 19:33:16 UTC 2021
On Tue, 13 Jul 2021 17:21:52 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
> Please consider this proposal to add `divideExact()` methods for integral data types to `java.lang.Math` thereby rounding out "exact" support to all four basic arithmetic operations.
Thanks. I was thinking of leveraging the `negateExact()` intrinsic instead:
// Leverage a potential intrinsic of negateExact()
return y == -1 ? Math.negateExact(x) : x/y;
-------------
PR: https://git.openjdk.java.net/jdk/pull/4770
More information about the core-libs-dev
mailing list