Re:Low Level Bit Hacks You Absolutely Must Know
by tonyarkles on Friday May 11, 2018 @01:32PM
(#17049249)
Javascript as well:
Edit: well, at least in Firefox JS. I have no idea if that's actually standard-mandated behaviour or if it's an implementation quirk. The -0 is especially weird (I had written odd but...)
[ Parent
| on HN ]
Re:Low Level Bit Hacks You Absolutely Must Know
by justin66 on Friday May 11, 2018 @01:40PM
(#17049312)
This is pretty interesting. I don't use js but I took a quick look and apparently (x % 2) == 0 as a test for even integers should still work properly there, since a comparison of -0 and 0 will consider them equivalent.