make sure Ox.isInt(Infinity) returns false

This commit is contained in:
rolux 2012-06-13 00:02:55 +02:00
parent 2e49324ede
commit fd04452db9

View file

@ -206,9 +206,11 @@ Ox.isInt <f> Tests if a value is an integer
true true
> Ox.isInt(0.5) > Ox.isInt(0.5)
false false
> Ox.isInt(Infinity)
false
@*/ @*/
Ox.isInt = function(value) { Ox.isInt = function(value) {
return value === Math.floor(value); return isFinite(value) && value === Math.floor(value);
}; };
/*@ /*@