Hacker News new | ask | show | jobs
by jpollock 3942 days ago
There is no substantial difference in performance on mine (within 2%), although the OR was always a little bit faster.

Chrome 45 on Linux

It's odd that a bitwise operator should have the effect of truncating the float (since X|0 == X)? I'm guessing there's an implicit type conversion to int in the middle?

1 comments

The bitwise operators don't make sense for floating-point values. So they work by converting to a 32-bit integer first.