Numbers.isEven()
Syntax
function isEven(value: number): boolean
Checks if a number is an even number.
Parameters | |
value
|
A number which may or may not be even. |
Example
import { Numbers } from 'potence';
Numbers.isEven(16); // -> true
Numbers.isEven(5); // -> false
Remarks
Floating point numbers are never even. The same goes for
NaN
,
Infinity
,
and -Infinity
.
Compare Numbers.isOdd()
.