I\'m using Math.ceil( Math.abs( x ) ) inside a loop.
Can anyone realize any optimization for this operation? (Bitwise or what?)
You are welcom
Javascript isn't a compiled language like C, so bitwise operations that can work wonders in such languages, aren't so great in JS because numbers are stored as 64 bit floating points. Take a look at this SO post.
Even then, what you write in JS will get transformed to native code somehow by underlying browser and it might be faster or slower, depending on implementation.
Since Math.ceil and Math.abs are built in; I'd guess they're heavily optimized, so I doubt you'll be able to get better performance by doing some trickery of your own.
Bottom line: three things stand in your way of doing it faster: