-
Notifications
You must be signed in to change notification settings - Fork 3k
[vm] Floating point discrepancy (-0.0 vs +0.0) between -emu_flavor emu
and -emu_flavor jit
#6717
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
Comments
…H-6717/OTP-18411 jit: Fix float negation on x64
Fixed in #6726, to be released in OTP 25.3. Thanks again for your report! :-) |
Hi, this is probably not a problem, but as, depending on these changes, it may be surprising, this might be worth reporting: certainly that floats shall not be compared based on strict equality, but this allowed me to notice that apparently (perhaps in link with this issue) Erlang 25.3 evaluates some floating-point operations a bit differently from the past versions. More context: this was detected in a simple test in CI, https://github.com/Olivier-Boudeville/Ceylan-Myriad/blob/352890f711d9f5c128360522c52a98d597f54d25/test/maths/vector4_test.erl#L102 which with 25.3 is now failing with
(again: not a bug, but a surprise) |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
On the following code:
Running it with
cerl -emu_flavor emu -noshell -pa . -s jit13564 wrapper0 -s init stop
results in-0.0
(which seems correct to me).But running it with
cerl -emu_flavor jit -noshell -pa . -s jit13564 wrapper0 -s init stop
results in0.0
.Expected behavior
I'd expect to get the same result from arithmetic operations regardless of whether the JIT is active or not.
Affected versions
Additional context
Replacing
f
bymakes the program return
-0.0
in both emu and jit flavors.The text was updated successfully, but these errors were encountered: