Subscribe to:
Post Comments (Atom)

skip to main |
skip to sidebar

Programming tricks related to ActionScript, Python, C/C++ and Java. See the comments for answers.

Subscribe to:
Post Comments (Atom)

## 1 comment:

value = (value < 0 ? Math.ceil(value) : Math.floor(value))

Note that the other solutions of (1) typecast to int() does not work for more than 32-bit numbers, because int is 32-bits whereas Number can be larger in AS3, and (2) Math.floor(value) doesn't work for negative numbers because floor(-4.3) == -5.

Post a Comment