Skip to content

Conversation

@zbynek
Copy link
Collaborator

@zbynek zbynek commented Nov 5, 2025

Fixes #9711 by using native emulation of log1p, expm1 and hypot.
Fixes #9663 by adding the implementation of IEEEremainder
Adds absExact, multiplyFull, ulp, and getExponent + missing variations of multiplyExact, floorDiv, floorMod for completeness.

Only missing methods for JVM 17 compatibility are multiplyHigh and fma which might be better handled in #9909

@zbynek zbynek force-pushed the math branch 6 times, most recently from 5f1c929 to b3a1847 Compare November 5, 2025 06:32
@zbynek zbynek added Category-JRE ready This PR has been reviewed by a maintainer and is ready for a CI run. labels Nov 5, 2025
@niloc132 niloc132 added this to the 2.13 milestone Nov 6, 2025
@niloc132
Copy link
Member

niloc132 commented Nov 6, 2025

While reviewing code elsewhere, I also noticed that DoubleTest.testDoubleConstants() has two checks that can be reenabled if we support getExponent() now

Comment on lines 425 to 499
assertEquals(Double.POSITIVE_INFINITY, Math.hypot(1, Double.NEGATIVE_INFINITY));
assertEquals(Double.POSITIVE_INFINITY, Math.hypot(Double.POSITIVE_INFINITY, 1));
assertEquals(Double.POSITIVE_INFINITY, Math.hypot(Double.NaN, Double.NEGATIVE_INFINITY));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning, these are boxing to Double without the third arg (either 0 or EPS in other lines)

zbynek added a commit that referenced this pull request Nov 8, 2025
SuppressWarnings makes it easier to see which warnings are actually
suppressed and removes the need for on/off toggles that might get
mismatched.

Moved out of #10176
zbynek and others added 3 commits November 9, 2025 00:36
…multest/java17/lang/MathTest.java

Co-authored-by: Colin Alworth <colin@vertispan.com>
Co-authored-by: Colin Alworth <colin@vertispan.com>
@zbynek zbynek force-pushed the math branch 2 times, most recently from d312268 to cf61d68 Compare November 9, 2025 23:58
Double.NEGATIVE_INFINITY), EPS);
}

public void testGetExponentWithFolding() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aside, constant folding doesn't work on non-String methods at this time #10147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category-JRE ready This PR has been reviewed by a maintainer and is ready for a CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

log1p(x) and expm1(x) innacurate for small x Add support for Math.IEEEremainder

2 participants