uint
v21.6.2
Published
Unsigned integer module from Glize library.
Downloads
50,934
Readme
Unsigned Integer
Unsigned integer module from Glize library.
Usage
npm install uint --save
import {uint8, uint16, uint32} from 'uint';
/**
* Converts given <code>number</code> to unsigned int8.
* @param {number} number The number to be converted.
* @return {number} The unsigned (zero or positive) number.
*/
console.log(uint8(0)); // 0
console.log(uint8(1)); // 1
console.log(uint8(255)); // 255
console.log(uint8(256)); // NaN
console.log(uint8(-256)); // NaN
console.log(uint8(-1)); // NaN
console.log(uint16(0)); // 0
console.log(uint16(1)); // 1
console.log(uint16(65535)); // 65535
console.log(uint16(65536)); // NaN
console.log(uint16(-65536)); // NaN
console.log(uint16(-1)); // NaN
console.log(uint32(0)); // 0
console.log(uint32(1)); // 1
console.log(uint32(4294967295)); // 4294967295
console.log(uint32(4294967296)); // NaN
console.log(uint32(-4294967296)); // NaN
console.log(uint32(-1)); // NaN
For more information please visit Glize project page.