Math Class
Extension of Math Copyright (c) 2014 ITSA - https://github.com/itsa New BSD License - http://choosealicense.com/licenses/bsd-3-clause/
Item Index
Methods
Methods
ceilFromZero
-
value
Ceils a value from zero up. Native Math.ceil does this for positive values, but negative values are ceiled more into the less negative (Math.ceil(-2.3) === -2). This method ceiles up from zero: (Math.ceilFromZero(-2.3) === -3)
Parameters:
-
value
Numberthe original value that should be inbetween the edges
Returns:
the floored value
floorToZero
-
value
Floors a value in the direction to zero. Native Math.floor does this for positive values, but negative values are floored more into the negative (Math.floor(-2.3) === -3). This method floores into the direction of zero: (Math.floorToZero(-2.3) === -2)
Parameters:
-
value
Numberthe original value that should be inbetween the edges
Returns:
the floored value