make sure Ox.isInt(Infinity) returns false
This commit is contained in:
parent
2e49324ede
commit
fd04452db9
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
|
|
Loading…
Reference in a new issue