I'm somewhat annoyed that JavaScript thinks 0 === -0 is true.
Conversation
Notices
-
Embed this notice
Ryan Castellucci :nonbinary_flag: (ryanc@infosec.exchange)'s status on Monday, 21-Oct-2024 03:36:54 JST Ryan Castellucci :nonbinary_flag: -
Embed this notice
Ryan Castellucci :nonbinary_flag: (ryanc@infosec.exchange)'s status on Monday, 21-Oct-2024 15:50:23 JST Ryan Castellucci :nonbinary_flag: isItTho = (a, b) => {
const t = new Float64Array([a, b]);
for (let i = 0; i < 8; ++i) {
if (t[i] != t[i+8]) return false;
}
return true;
}also handles comparing NaNs which may or may not be the same.
-
Embed this notice
John Ripley (jripley@mastodon.social)'s status on Monday, 21-Oct-2024 15:50:24 JST John Ripley -
Embed this notice
samir, stack-based (samir@mastodon.functional.computer)'s status on Monday, 21-Oct-2024 15:50:25 JST samir, stack-based @ryanc I guess we need a `====` operator.
-
Embed this notice