The problem with this technique is that it will not work for large numbers (in my build of node, for example, the largest number it will work with is 2^31 - 1:
(Math.pow(2, 31) - 0.1) // base number
2147483647.9
~~(Math.pow(2, 31) - 0.1) // works!
2147483647
(Math.pow(2, 31) + 0.1) // base number
2147483648.1
~~(Math.pow(2, 31) + 0.1) // doesn't work!
-2147483648