Added Math.isEven and isEvenStrict

This commit is contained in:
Richard Davey 2017-06-27 23:23:09 +01:00
parent eddb17f5a6
commit 65e2deb203
4 changed files with 17 additions and 1 deletions

View file

@ -1,4 +1,4 @@
var CHECKSUM = {
build: '3742be10-5b7d-11e7-8005-ef6dcee762ca'
build: 'f2d24020-5b86-11e7-923f-e7e69f9cb7f2'
};
module.exports = CHECKSUM;

7
v3/src/math/IsEven.js Normal file
View file

@ -0,0 +1,7 @@
var IsEven = function (value)
{
// Use abstract equality == for "is number" test
return (value == parseFloat(value)) ? !(value % 2) : void 0;
};
module.exports = IsEven;

View file

@ -0,0 +1,7 @@
var IsEvenStrict = function (value)
{
// Use strict equality === for "is number" test
return (value === parseFloat(value)) ? !(value % 2) : void 0;
};
module.exports = IsEvenStrict;

View file

@ -34,6 +34,8 @@ module.exports = {
FloatBetween: require('./FloatBetween'),
FloorTo: require('./FloorTo'),
GetSpeed: require('./GetSpeed'),
IsEven: require('./IsEven'),
IsEvenStrict: require('./IsEvenStrict'),
Linear: require('./Linear'),
MaxAdd: require('./MaxAdd'),
MinSub: require('./MinSub'),