craftyjs/Crafty — pull request #368 by mcmorgan (2012-10-27 14:44:57+00:00)
Title: Use round instead of ceil/floor to correct inconsistencies

Math.cos(90), effectively Math.cos(Math.PI/2), returns
6.123031769111886e-17 when 0 is the expected result. This value is close
to zero and it is safer to use the Math#round method which will round it
to the nearest whole number rather than Math#ceil/Math.floor which are
affected by the negative numbers.

Math.floor(-6.123031769111886e-17) will resut in -1

while

Math.round(-6.123031769111886e-17) will resut in 0 (expected)