extra-integer.min v2.0.49
32-bit integer can store values from −2^31 to 2^31 − 1. :package: NPM, :smiley_cat: GitHub, :running: RunKit, :vhs: Asciinema, :moon: Minified, :scroll: Files, :newspaper: JSDoc, :blue_book: Wiki.
This package includes bit twiddling hacks, for integers, by Sean Eron Anderson and many others.
Methods as separate packages:
@extra-integer/log2
: use rollup to bundle this es module.@extra-integer/log2.min
: use in browser (browserify, uglify-js).
Stability: Experimental
This is browserified, minified version of extra-integer. It is exported as global variable integer. CDN: unpkg, jsDelivr.
const integer = require("extra-integer");
// import * as integer from "extra-integer";
// import * as integer from "https://unpkg.com/extra-integer@2.0.30/index.mjs"; (deno)
integer.is(9.11e-31);
// false
integer.log10(10000);
// 4
integer.nextPow2(63);
// 64
Index
Method | Action |
---|---|
is | Checks if value is int32. |
abs | Gets absolute value. |
log2 | Finds log-base-2. |
pow2 | Finds power-of-2. |
isPow2 | Checks if value is a power-of-2. |
nextPow2 | Finds next power-of-2. |
prevPow2 | Finds previous power-of-2. |
signEqual | Checks if two values have equal sign. |
MIN_VALUE | Minimum int32 value. |
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago