[Poll] What do you get if you add two negative zeroes in JavaScript?
-0 + -0
No cheating! #jsquiz
-
Show this thread
-
Replying to @mathias
How do you even know what the result is? -0 === +0, so how do you test the result?
1 reply 0 retweets 0 likes -
Replying to @sil
See http://www.wirfs-brock.com/allen/posts/128 by
@awbjs: const isNegative0 = (x) => x === 0 && (1 / x) === -Infinity;3 replies 1 retweet 8 likes -
In modern JS (eg, starting with ES2015) http://Object.is can be used to test for -0
1 reply 0 retweets 11 likes
Time to update the blog post!
4:37 PM - 24 Jan 2018
0 replies
0 retweets
5 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.