Utils.getSign()
Return the sign (-1, 1 or 0) of the number given as parameter
Parameters
Name | Type | Description | |
---|---|---|---|
1 | x | number |
Return value
number
the sign
Usage
import {Utils} from '@lcluber/type6js';
console.log(Utils.getSign(2)); //1
console.log(Utils.getSign(-2)); //-1
console.log(Utils.getSign(0)); //0