-
Notifications
You must be signed in to change notification settings - Fork 381
Math emulation improvements #10176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Math emulation improvements #10176
Conversation
5f1c929 to
b3a1847
Compare
user/test-super/com/google/gwt/emultest/super/com/google/gwt/emultest/java17/lang/MathTest.java
Outdated
Show resolved
Hide resolved
user/test-super/com/google/gwt/emultest/super/com/google/gwt/emultest/java17/lang/MathTest.java
Show resolved
Hide resolved
user/test-super/com/google/gwt/emultest/super/com/google/gwt/emultest/java17/lang/MathTest.java
Outdated
Show resolved
Hide resolved
|
While reviewing code elsewhere, I also noticed that DoubleTest.testDoubleConstants() has two checks that can be reenabled if we support getExponent() now |
dev/core/src/com/google/gwt/dev/js/JsToStringGenerationVisitor.java
Outdated
Show resolved
Hide resolved
| 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)); |
There was a problem hiding this comment.
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)
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
…multest/java17/lang/MathTest.java Co-authored-by: Colin Alworth <colin@vertispan.com>
Co-authored-by: Colin Alworth <colin@vertispan.com>
d312268 to
cf61d68
Compare
| Double.NEGATIVE_INFINITY), EPS); | ||
| } | ||
|
|
||
| public void testGetExponentWithFolding() { |
There was a problem hiding this comment.
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
Fixes #9711 by using native emulation of
log1p,expm1andhypot.Fixes #9663 by adding the implementation of
IEEEremainderAdds
absExact,multiplyFull,ulp, andgetExponent+ missing variations ofmultiplyExact,floorDiv,floorModfor completeness.Only missing methods for JVM 17 compatibility are
multiplyHighandfmawhich might be better handled in #9909