Conversation
Member
|
what's the root cause? |
Member
Author
|
Firefox and Safari's JS engine (as well as wasm) implements NaN canonicalization, which is allowing only one specific bit representation of NaN. The following code shows the difference on Chrome and Firefox's console: const f64 = new Float64Array(1);
const u64 = new BigUint64Array(f64.buffer);
u64[0] = 0x7ff8000000000001n; // NaN #1
const nan1 = f64[0];
u64[0] = 0x7ff8000000000002n; // NaN #2
const nan2 = f64[0];
f64[0] = nan1;
console.log("NaN #1 bits:", u64[0].toString(16));
f64[0] = nan2;
console.log("NaN #2 bits:", u64[0].toString(16));libime's libime/src/libime/core/datrie.cpp Lines 73 to 78 in 12b62cb thus works only on Chrome. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.