Node.js examples for Number:Int
Add integers, wrapping at 2^32. This uses 16-bit operations internally to work around bugs in some JS interpreters.
function safe_add(x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); }