New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

extra-integer

Package Overview
Dependencies
Maintainers
1
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extra-integer

A 32-bit integer can store values from -2^31 to 2^31 - 1.

latest
Source
npmnpm
Version
2.2.2
Version published
Maintainers
1
Created
Source

A 32-bit integer can store values from -2^31 to 2^31 - 1.
📦 Node.js, 🌐 Web, 📜 Files, 📰 Docs, 📘 Wiki.

This package deals with the manipulation of 32-bit integers in JavaScript, which can store values ranging from -2^31 (MIN_VALUE) to 2^31 - 1 (MAX_VALUE). JavaScript converts a Number (a 64-bit floating point number) to a 32-bit integer (int32) when bitwise operators (such as |) are applied.

Use is to check is a number can be represented as a 32-bit integer. Sign-based operations include abs and signEqual. Power/logarithm related operations include isPow2, prevPow2, nextPow2, pow2, pow10, log2, and log10.

This package is available in Node.js and Web formats. To use it on the web, simply use the extra_integer global variable after loading with a <script> tag from the jsDelivr CDN.

Stability: Experimental.


const xinteger = require('extra-integer');
// import * as xinteger from "extra-integer";
// import * as xinteger from "https://unpkg.com/extra-integer/index.mjs"; (deno)

xinteger.is(9.11e-31);
// → false

xinteger.log10(10000);
// → 4

xinteger.nextPow2(63);
// → 64


Index

PropertyDescription
MIN_VALUEMinimum int32 value.
MAX_VALUEMaximum int32 value.
isCheck if value is int32.
absGet the absolute of an int32.
signEqualCheck if two int32s have equal sign.
isPow2Check if int32 is a power-of-2.
prevPow2Find previous power-of-2 of an int32.
nextPow2Find next power-of-2 of an int32.
pow2Find the power-of-2 of an int32.
pow10Find the power-of-10 of an int32.
log2Find the base-2 logarithm of an int32.
log10Find the base-10 logarithm of an int32.


References




ORG DOI Coverage Status Test Coverage Maintainability

Keywords

extra

FAQs

Package last updated on 08 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts