1.1.18 โ€ข Published 1 month ago

extra-bigint.web v1.1.18

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

A BigInt can represent whole numbers larger than 2โตยณ - 1 (1). ๐Ÿ“ฆ Node.js, ๐ŸŒ Web, ๐Ÿ“œ Files, ๐Ÿ“ฐ Docs, ๐Ÿ“˜ Wiki.

ES2020 introduced BigInt 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. To use it on the web, simply use the extra_bigint global variable after loading with a <script> tag from the jsDelivr CDN.

Stability: Experimental.

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

xbigint.isPrime(113n);
// โ†’ true

xbigint.floorDiv(7n, 3n);
// โ†’ 2n

xbigint.sqrt(81n);
// โ†’ 9n

xbigint.lcm(2n, 3n, 4n);
// โ†’ 12n

xbigint.log2(8n);
// โ†’ 3n

xbigint.sum(1n, 2n, 3n, 4n);
// โ†’ 10n

xbigint.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 largest power-of-2 less than or equal to given bigint.
prevPow10Find largest power-of-10 less than or equal to given bigint.
nextPow2Find smallest power-of-2 greater than or equal to given bigint.
nextPow10Find smallest power-of-10 greater than or equal to given 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.
minPrimeFactorFind the least prime number which divides a bigint.
maxPrimeFactorFind the greatest prime number which divides a bigint.
primeFactorsFind the prime factors of a bigint.
primeExponentialsFind the prime factors and respective exponents 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.

npm.io ORG DOI Coverage Status Test Coverage Maintainability

1.1.18

1 month ago

1.1.17

6 months ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.10

1 year ago

1.0.62

1 year ago

1.0.61

1 year ago

1.0.60

1 year ago

1.0.66

1 year ago

1.0.65

1 year ago

1.0.64

1 year ago

1.0.63

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.40

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.48

1 year ago

1.0.47

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.49

1 year ago

1.0.51

1 year ago

1.0.50

1 year ago

1.0.55

1 year ago

1.0.54

1 year ago

1.0.53

1 year ago

1.0.52

1 year ago

1.0.59

1 year ago

1.0.58

1 year ago

1.0.57

1 year ago

1.0.56

1 year ago

1.0.33

2 years ago

1.0.34

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago