File size: 446 Bytes
bc20498 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
function IMath() {
}
/**
* This method returns the sign of the input value.
*/
IMath.sign = function (value) {
if (value > 0)
{
return 1;
}
else if (value < 0)
{
return -1;
}
else
{
return 0;
}
};
IMath.floor = function (value) {
return value < 0 ? Math.ceil(value) : Math.floor(value);
};
IMath.ceil = function (value) {
return value < 0 ? Math.floor(value) : Math.ceil(value);
};
module.exports = IMath;
|