extra-math 1.3.20 → 1.3.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -25,6 +25,7 @@ declare function modp(x: number, y: number): number;
25
25
  * @returns gcd(x₁, x₂, ...)
26
26
  */
27
27
  declare function gcd(...xs: number[]): number;
28
+
28
29
  /**
29
30
  * Find the least common multiple of numbers.
30
31
  * @param xs a list of numbers
@@ -59,6 +60,7 @@ declare function multinomial(...ks: number[]): number;
59
60
  * @returns x<min: min, x>max: max, x
60
61
  */
61
62
  declare function constrain(x: number, min: number, max: number): number;
63
+
62
64
  /**
63
65
  * Normalize a number from its current range into a value between 0 and 1.
64
66
  * @param x a number
@@ -191,4 +193,4 @@ declare function range(...xs: number[]): number;
191
193
  */
192
194
  declare function variance(...xs: number[]): number;
193
195
 
194
- export { binomial, constrain, degrees, distance, erf, erfc, factorial, gamma, gcd, lcm, lerp, lgamma, log, magnitude, map, mean, median, mod, modes, modp, multinomial, norm, product, radians, range, rem, root, sum, variance };
196
+ export { binomial, constrain as clamp, constrain, degrees, distance, erf, erfc, factorial, gamma, gcd, gcd as hcf, lcm, lerp, lgamma, log, magnitude, map, mean, median, mod, modes, modp, multinomial, norm, product, radians, range, rem, root, sum, variance };
package/index.js CHANGED
@@ -205,6 +205,7 @@ function variance(...xs) {
205
205
  }
206
206
 
207
207
  exports.binomial = binomial;
208
+ exports.clamp = constrain;
208
209
  exports.constrain = constrain;
209
210
  exports.degrees = degrees;
210
211
  exports.distance = distance;
@@ -213,6 +214,7 @@ exports.erfc = erfc;
213
214
  exports.factorial = factorial;
214
215
  exports.gamma = gamma;
215
216
  exports.gcd = gcd;
217
+ exports.hcf = gcd;
216
218
  exports.lcm = lcm;
217
219
  exports.lerp = lerp;
218
220
  exports.lgamma = lgamma;
package/index.mjs CHANGED
@@ -200,4 +200,4 @@ function variance(...xs) {
200
200
  return a / xs.length;
201
201
  }
202
202
 
203
- export { binomial, constrain, degrees, distance, erf, erfc, factorial, gamma, gcd, lcm, lerp, lgamma, log, magnitude, map, mean, median, mod, modes, modp, multinomial, norm, product, radians, range, rem, root, sum, variance };
203
+ export { binomial, constrain as clamp, constrain, degrees, distance, erf, erfc, factorial, gamma, gcd, gcd as hcf, lcm, lerp, lgamma, log, magnitude, map, mean, median, mod, modes, modp, multinomial, norm, product, radians, range, rem, root, sum, variance };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "extra-math",
3
- "version": "1.3.20",
3
+ "version": "1.3.21",
4
4
  "description": "A collection of common mathematical functions.",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -17,6 +17,8 @@
17
17
  "keywords": [
18
18
  "extra",
19
19
  "math",
20
+ "clamp",
21
+ "hcf",
20
22
  "binomial",
21
23
  "constrain",
22
24
  "degrees",