High cost of failed Math.*Exact calls
Charles Oliver Nutter
headius at headius.com
Sat Jan 11 02:59:15 UTC 2025
On Fri, Jan 10, 2025 at 8:48 PM Charles Oliver Nutter <headius at headius.com>
wrote:
> This pasted weirdly... but it doesn't matter because there's an additional
> flaw: it will reject *all* negative results because the high 64 bits will
> be non-zero.
>
This version passes all my tests:
if ((high == 0 && low >= 0) // result is within [0, MAX]
|| (high == -1 && low < 0)) { // result is within [MIN, 0)
return low;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250110/24025a57/attachment-0001.htm>
More information about the core-libs-dev
mailing list