>>240
A bithack is a low-level trick which replaces something complex with a series of low-latency opcodes
nope, they are still bitwise operations.
(xsum>=0)[b]|[/b]0
another reason why JS is shit. You are just making an unnecessary operation. it is Java's fault because if it does not have a proper type conversion. (or proper types at all)
(xsum>=0)|0)[b]<<[/b]1
holy shit, he replaced *2 with <<1. Stop the presses, we have a second Einstein here.
xsum[b]*[/b]((((xsum>=0)|0)<<1)[b]-[/b]1)
these are not bit wise operations
so you have 2 bitwise operations in your "bithack". one simply replaces *2 other is used to covert something into integer.
also I wonder how many cycles
xsum=xsum>0?xsum:-xsum losts in a branch prediction. Does it really justify an addition, bitshift and a multiplication operation.
seriosuly, if you think bitwise operations are cool and into "bithack", go play with C and do something like this
http://codepad.org/d2C0BhOB