🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

extra-bigint

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extra-bigint

A collection of functions for working with BigInts.

Source
npmnpm
Version
1.0.46
Version published
Weekly downloads
28K
7.83%
Maintainers
1
Weekly downloads
 
Created
Source

A collection of functions for working with BigInts.
📦 Node.js, 🌐 Web, 📜 Files, 📰 Docs, 📘 Wiki.

A BigInt can represent whole numbers larger than 2⁵³ - 1 (1). ES2020 introduced it as a built-in object. BigInt enables us to represent integers with arbitrary precision, allowing us to perform mathematical operations on large integers (2). This package includes common bigint functions related to querying about numbers, comparing numbers, performing rounded division, performing modulo operations, controlling range of numbers, performing arithmetic operations, obtaining divisors of a number (and related operations), getting the number of possible arrangements of a set of objects, performing geometry-related calculations, performing basic statistical analysis, and finding various statistical means.

This package is available in Node.js and Web formats. The web format is exposed as extra_bigint standalone variable and can be loaded from jsDelivr CDN.

Stability: Experimental.


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

bigint.isPrime(113n);
// → true

bigint.floorDiv(7n, 3n);
// → 2n

bigint.sqrt(81n);
// → 9n

bigint.lcm(2n, 3n, 4n);
// → 12n

bigint.log2(8n);
// → 3n

bigint.sum(1n, 2n, 3n, 4n);
// → 10n

bigint.mean(1n, 7n, 8n);
// → 5n


Index

PropertyDescription
isCheck if value is a bigint.
compareCompare two bigints.
absGet the absolute of a bigint.
signGet the sign of a bigint.
floorDivPerform floor-divison of two bigints (\).
ceilDivPerform ceiling-divison of two bigints.
roundDivPerform rounded-divison of two bigints.
remFind the remainder of x/y with sign of x (truncated division).
modFind the remainder of x/y with sign of y (floored division).
modpFind the remainder of x/y with +ve sign (euclidean division).
constrainConstrain a bigint within a minimum and a maximum value.
remapRe-map a bigint from one range to another.
lerpLinearly interpolate a bigint between two bigints.
isPow2Check if bigint is a power-of-2.
isPow10Check if bigint is a power-of-10.
prevPow2Find previous power-of-2 of a bigint.
prevPow10Find previous power-of-10 of a bigint.
nextPow2Find next power-of-2 of a bigint.
nextPow10Find next power-of-10 of a bigint.
log2Find the base-2 logarithm of a bigint.
log10Find the base-10 logarithm of a bigint.
sqrtFind the square root of a bigint.
cbrtFind the cube root of a bigint.
rootFind the nth root of a bigint.
properDivisorsList all divisors of a bigint, except itself.
aliquotSumSum all proper divisors of a bigint.
isPrimeCheck if bigint is prime.
gcdFind the greatest common divisor of bigints.
lcmFind the least common multiple of bigints.
factorialFind the factorial of a bigint.
binomialFind the number of ways to choose k elements from a set of n elements.
multinomialFind the number of ways to put n objects in m bins (n=sum(kᵢ)).
hypotFind the length of hypotenuse.
sumFind the sum of bigints (Σ).
productFind the product of bigints (∏).
medianFind the value separating the higher and lower halves of bigints.
modesFind the values that appear most often.
minFind the smallest bigint.
maxFind the largest bigint.
rangeFind the minimum and maximum bigint.
varianceFind the mean of squared deviation of bigints from its mean.
arithmeticMeanFind the arithmetic mean of bigints (µ).
geometricMeanFind the geometric mean of bigints.
harmonicMeanFind the harmonic mean of bigints.
quadriaticMeanFind the quadriatic mean of bigints.
cubicMeanFind the cubic mean of bigints.



ORG DOI Coverage Status Test Coverage Maintainability

Keywords

extra

FAQs

Package last updated on 02 Nov 2022

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