2.3.25 โ€ข Published 6 months ago

extra-number v2.3.25

Weekly downloads
31
License
MIT
Repository
github
Last release
6 months ago

A number is a mathematical object used to count, measure, and label. ๐Ÿ“ฆ Node.js, ๐ŸŒ Web, ๐Ÿ“œ Files, ๐Ÿ“ฐ Docs. ๐Ÿ“˜ Wiki.

In JavaScript, Number type is double-precision 64-bit binary format IEEE 754 value. This package includes common number functions related to querying about numbers, comparing numbers, rounding 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_number global variable after loading with a <script> tag from the jsDelivr CDN.

Stability: Experimental.

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

xnumber.isPrime(53);
// โ†’ true

xnumber.properDivisors(6);
// โ†’ [1, 2, 3]

xnumber.round(9.1357, 0.05);
// โ†’ 9.15

xnumber.significantDigits(0.0034);
// โ†’ 2

// TOFIX:
// xnumber.fromRoman('DCXLIX');
// โ†’ 649

// xnumber.toScientific(695700000);
// โ†’ '6.957ร—10โธ' (radius of Sun in m)

Index

PropertyDescription
isCheck if value is a number.
significantDigitsCount the number of significant digits in a number.
compareCompare two numbers.
floorRound down a number to specific precision.
ceilRound up a number to specific precision.
roundRound a number to specific precision.
floorDivPerform floor-divison of two numbers.
ceilDivPerform ceiling-divison of two numbers.
roundDivPerform rounded-divison of two numbers.
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 number within a minimum and a maximum value.
normalizeNormalize a number from its current range into a value between 0 and 1.
remapRe-map a number from one range to another.
lerpLinearly interpolate a number between two numbers.
isPowCheck if a number is a power-of-n.
prevPowFind largest power-of-n less than or equal to given number.
nextPowFind smallest power-of-n greater than or equal to given number.
rootFind the nth root of a number (โฟโˆš).
logFind the logarithm of a number with a given base.
properDivisorsList all divisors of a number, except itself.
aliquotSumSum all proper divisors of a number.
minPrimeFactorFind the least prime number which divides a number.
maxPrimeFactorFind the greatest prime number which divides a number.
primeFactorsFind the prime factors of a number.
primeExponentialsFind the prime factors and respective exponents of a number.
isPrimeCheck if number is prime.
gcdFind the greatest common divisor of numbers.
lcmFind the least common multiple of numbers.
factorialFind the factorial of a number.
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แตข)).
degreesConvert radians to degrees.
radiansConvert degrees to radians.
sumFind the sum of numbers (ฮฃ).
productFind the product of numbers (โˆ).
medianFind the value separating the higher and lower halves of numbers.
modesFind the values that appear most often.
rangeFind the smallest and largest values.
varianceFind the mean of squared deviation of numbers from its mean.
arithmeticMeanFind the average of numbers.
geometricMeanFind the geometric mean of numbers.
harmonicMeanFind the harmonic mean of numbers.
quadriaticMeanFind the quadriatic mean of numbers.
cubicMeanFind the cubic mean of numbers.

References

npm.io ORG DOI Coverage Status Test Coverage Maintainability

2.3.24

6 months ago

2.3.23

6 months ago

2.3.25

6 months ago

2.3.20

12 months ago

2.3.22

12 months ago

2.3.21

12 months ago

2.3.6

1 year ago

2.3.8

1 year ago

2.3.7

1 year ago

2.3.9

1 year ago

2.3.17

12 months ago

2.3.16

12 months ago

2.3.19

12 months ago

2.3.18

12 months ago

2.3.13

12 months ago

2.3.12

12 months ago

2.3.15

12 months ago

2.3.14

12 months ago

2.3.11

12 months ago

2.3.10

1 year ago

2.3.5

1 year ago

2.2.55

1 year ago

2.2.56

1 year ago

2.2.53

1 year ago

2.2.54

1 year ago

2.2.51

1 year ago

2.2.52

1 year ago

2.2.50

1 year ago

2.3.0

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.4

1 year ago

2.3.3

1 year ago

2.2.48

1 year ago

2.2.49

1 year ago

2.2.46

1 year ago

2.2.47

1 year ago

2.2.44

1 year ago

2.2.45

1 year ago

2.2.42

2 years ago

2.2.43

2 years ago

2.1.9

2 years ago

2.2.17

2 years ago

2.2.1

2 years ago

2.2.18

2 years ago

2.2.0

2 years ago

2.2.15

2 years ago

2.2.3

2 years ago

2.2.16

2 years ago

2.2.2

2 years ago

2.2.13

2 years ago

2.2.5

2 years ago

2.2.14

2 years ago

2.2.4

2 years ago

2.2.11

2 years ago

2.2.7

2 years ago

2.2.12

2 years ago

2.2.6

2 years ago

2.2.10

2 years ago

2.2.19

2 years ago

2.2.28

2 years ago

2.2.29

2 years ago

2.2.26

2 years ago

2.2.27

2 years ago

2.2.24

2 years ago

2.2.25

2 years ago

2.2.22

2 years ago

2.2.23

2 years ago

2.2.20

2 years ago

2.2.21

2 years ago

2.2.39

2 years ago

2.2.37

2 years ago

2.1.4

2 years ago

2.2.38

2 years ago

2.2.35

2 years ago

2.1.6

2 years ago

2.2.36

2 years ago

2.1.5

2 years ago

2.2.33

2 years ago

2.2.34

2 years ago

2.1.7

2 years ago

2.2.31

2 years ago

2.2.32

2 years ago

2.2.30

2 years ago

2.2.8

2 years ago

2.2.40

2 years ago

2.2.41

2 years ago

2.0.27

3 years ago

2.0.26

4 years ago

2.0.25

4 years ago

2.0.24

4 years ago

2.0.23

4 years ago

2.0.22

4 years ago

2.0.21

4 years ago

2.0.20

4 years ago

2.0.19

4 years ago

2.0.18

4 years ago

2.0.17

4 years ago

2.0.16

4 years ago

2.0.15

4 years ago

2.0.14

4 years ago

2.0.13

4 years ago

2.0.12

4 years ago

2.0.11

4 years ago

2.0.7

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.10

4 years ago

2.0.5

4 years ago

2.0.6

4 years ago

2.0.3

4 years ago

2.0.4

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.3.10

4 years ago

1.3.11

4 years ago

1.3.9

4 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.19

4 years ago

1.2.18

4 years ago

1.2.17

4 years ago

1.2.16

4 years ago

1.2.15

4 years ago

1.2.14

4 years ago

1.2.13

4 years ago

1.2.12

4 years ago

1.2.11

4 years ago

1.2.0

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.9

4 years ago

1.2.10

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

0.2.19

5 years ago

0.2.18

6 years ago

0.2.17

6 years ago

0.2.16

6 years ago

0.0.1

6 years ago