JSPM

  • Created
  • Published
  • Downloads 70
  • Score
    100M100P100Q73229F
  • License MIT

Mathematics is the classification and study of all possible patterns.

Package Exports

  • extra-math

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (extra-math) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Mathematics is the classification and study of all possible patterns (1). This package includes some common statistics functions.

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

math.sum(1, 2, 3, 4);
// 10

math.median(1, 7, 8);
// 7

math.variance(1, 2, 3, 4);
// 1.25

math.lcm(2, 3, 4);
// 12

reference

Method Action
sum Gives sum of numbers (Σ).
product Gives product of numbers (∏).
mean Gives average of numbers.
median Gives the value separating the higher and lower halves of numbers.
modes Gives the values that appear most often.
range Gives the difference between the largest and smallest values.
variance Gives the mean of squared deviation of numbers from its mean.
erf Gives error function value of number (approximation).
erfc Gives complementary error function value of number (approximation).
rem Gets remainder of x/y with sign of x (truncated division).
mod Gets remainder of x/y with sign of y (floored division).
modp Gets remainder of x/y with +ve sign (euclidean division).
gcd Gives greatest common divisor of numbers.
lcm Gives least common multiple of numbers.
binomial Gives ways to choose k elements from a set of n elements.
multinomial Gives ways to put n objects in m bins (n=sum(ki)).

nodef

Browserified, minified version of this package is extra-math.min.