Package Exports
- extra-math
Readme
Mathematics is the classification and study of all possible patterns.
This package includes some common statistics functions. (1)
📦 NPM,
😺 GitHub,
🏃 RunKit,
📼 Asciinema,
🌔 Minified,
📜 Files,
📰 JSDoc,
📘 Wiki.
Stability: Experimental.
const math = require("extra-math");
// import * as math from "extra-math";
// import * as math from "https://unpkg.com/extra-math@1.1.15/index.mjs"; (deno)
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);
// 12Index
| Method | Action |
|---|---|
| sum | Get sum of numbers (Σ). |
| product | Get product of numbers (∏). |
| mean | Get average of numbers. |
| median | Get the value separating the higher and lower halves of numbers. |
| modes | Get the values that appear most often. |
| range | Get the difference between the largest and smallest values. |
| variance | Get the mean of squared deviation of numbers from its mean. |
| erf | Get error function value of number (approximation). |
| erfc | Get complementary error function value of number (approximation). |
| rem | Get remainder of x/y with sign of x (truncated division). |
| mod | Get remainder of x/y with sign of y (floored division). |
| modp | Get remainder of x/y with +ve sign (euclidean division). |
| gcd | Get greatest common divisor of numbers. |
| lcm | Get least common multiple of numbers. |
| binomial | Get ways to choose k elements from a set of n elements. |
| multinomial | Get ways to put n objects in m bins (n=sum(ki)). |
