Converts a value to Uint24.
The abstract operation ToUint24 converts argument to one of 2^24 integer values in the range 0 through 2^24-1, inclusive.
Kind: Exported function
Returns: number
- Integer value, 0 through 2^24-1, inclusive.
Param | Type | Description |
---|---|---|
argument | number |
The argument to convert to one of 2^24 integers. |
Example
import toUint24 from 'to-uint-24-x';
console.log(toUint24(1)); // 1
console.log(toUint24(-1)); // 16777215 (2^24-1)