-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
test: math: test floating-point behavior when mapping zero to zero #59265
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
test: math: test floating-point behavior when mapping zero to zero #59265
Conversation
The idea for this addition to the test suite originates here, where stevengj suggested to do this test for `cosc` specifically: * JuliaLang#59087 (comment) This PR instead tests all applicable functions I could find.
|
Can be fixed by taking the line iszero(s) && return s immediately afterwards. (Otherwise it computes one extra term in the Taylor series, which messes up the sign of zero because |
Should it also test binary operators, like |
This looks questionable: julia> div(-0.0, 1.0)
0.0 |
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Should be good to merge. In principle, we could backport the |
The idea for this addition to the test suite originates here, where stevengj suggested to do this test for
cosc
specifically:cosc(::Float32)
andcosc(::Float64)
accuracy #59087 (comment)This PR instead tests all applicable functions I could find.
Also fix the sign of
cosc(::BigFloat)
for zero input, thanks to stevengj.