2.0.27 • Published 3 years ago

extra-number.min v2.0.27

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

A number is a mathematical object used to count, measure, and label.

Number type is double-precision 64-bit binary format IEEE 754 value. Includes notation conversion functions, as well as utilities.

This is browserified, minified version of extra-number. It is exported as global variable number. CDN: unpkg, jsDelivr.

const number = require('extra-number');

number.isPrime(53);
// true

number.properDivisors(6);
// [1, 2, 3]

number.round(9.1357, 0.05);
// 9.15

number.significantDigits(0.0034);
// 2

number.fromRoman('DCXLIX');
// 649

number.toScientific(695700000);
// '6.957×10⁸' (radius of Sun in m)

reference

MethodAction
isChecks if value is a number.
isPrimeChecks if a number is prime.
compareCompares 2 numbers.
roundRounds number to specific precision.
ceilRounds up number to specific precision.
floorRounds down number to specific precision.
lerpGives a number based on weight, within given range.
clampLimits a number within given range.
mapConverts a number from one range to another.
aliquotSumGives sum of all proper divisors of n.
properDivisorsGives a list of numbers that n is divisible by, except itself.
significantDigitsCounts the number of significant digits of a number.
fromWordsConverts number in words to number.
fromRomanConverts roman numerals to number.
toRomanConverts number to roman numerals.
fromScientificConverts scientific notation to number.
toScientificConverts number to scientific notation.

help needed

  • fromWords with plural
  • fromRoman with decimal
  • toWords(opt=ordinal/cardinal)
  • toOrdinal
  • number.compare(pre)
  • math.log(n,base)
  • math.factorial(n)
  • math.perm(n, k)
  • math.dist()
  • math.degrees()
  • math.radians()
  • math.tau
  • math: separate statistics?

nodef

2.0.27

3 years ago

2.0.26

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.2

4 years ago

1.3.1

4 years ago

1.2.19

4 years ago

1.2.18

4 years ago

1.2.14

4 years ago

1.2.15

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