Open
Bug 1393085
Opened 7 years ago
Updated 6 months ago
Float32 to Float64 (resp. Float32 to Float64) typed array constructor needs to canonicalize NaNs
Categories
(Core :: JavaScript: Standard Library, enhancement, P3)
Core
JavaScript: Standard Library
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox57 | --- | affected |
People
(Reporter: anba, Unassigned)
References
(Blocks 1 open bug)
Details
Test case:
---
var ta = new Float32Array(2);
new Uint32Array(ta.buffer)[0] = 0x7f800005;
new Uint32Array(ta.buffer)[1] = 0x7f800007;
var tb = new Float32Array(new Float64Array(ta));
print(new Uint32Array(tb.buffer)[0].toString(16));
print(new Uint32Array(tb.buffer)[1].toString(16));
---
Expected:
- NaN payload is removed
Actual:
- NaN payload is still present
https://tc39.github.io/ecma262/#sec-typedarray-typedarray calls GetValueFromBuffer (https://tc39.github.io/ecma262/#sec-getvaluefrombuffer), which in turn calls RawBytesToNumber (https://tc39.github.io/ecma262/#sec-rawbytestonumber), which canonicalizes NaN values.
Updated•7 years ago
|
Priority: -- → P3
Updated•2 years ago
|
Severity: normal → S3
Updated•6 months ago
|
Severity: S3 → N/A
Comment 1•6 months ago
|
||
NaN canonicalization has moved to https://tc39.es/ecma262/#sec-rawbytestonumeric, tho I don't think anyone is doing this right now..
You need to log in
before you can comment on or make changes to this bug.
Description
•