-
Notifications
You must be signed in to change notification settings - Fork 662
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
Hermes does not canonicalize NaNs stored in typed array #1639
Labels
need more info
Awating additional info before proceeding
Comments
Thank you. A better repro: let buffer = new ArrayBuffer(4);
var arrInt = new Int32Array(buffer);
var arr32 = new Float32Array(buffer);
var a = NaN;
arr32[0] = -a;
print(arr32[0]);
print(arrInt[0].toString(16)); v8: -400000 |
Is this actually a bug? These seem to be different representations of NaN. |
According to the spec:
Not 100% sure what it means. |
So far my interpretation of the spec and various discussions is that this is fine. Canonicalizing every NaN on writes to a floating point typed array might get pretty expensive in some scenarios. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
Hermes return different results in O0 and Og.
Hermes git revision (if applicable):01d96f4198789446b0e14226ec646b38f0ec3fd0 in branch static_h
OS: Linux
Platform: x86_64
Steps To Reproduce
code example:
Result of Step 2:
1.058925634e-314
Result of Step 3:
2.1199235295e-314
The Expected Behavior
The results of Step 2 and Step 3 should be the same.
The text was updated successfully, but these errors were encountered: