Why the methods from Math is faster than the bitwise operators in Javascript?
For example:
- Math.floor vs | 0. ( http://jsperf.com/floor-vs-bitwise22 )
- Math.max vs a ^ ((a ^ b) & -(a < b)) ( http://jsperf.com/max-vs-bitwise-22 )
- Math.min vs b ^ ((a ^ b) & -(a < b)) ( http://jsperf.com/min-vs-bitwise-22 )
I want to know at implementation level, because executing something at bit level I thought I would jump all the translations and calls that a computer is gonna do to make what I want, at bit level, which is less cpu operations.
What's happening?