Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thi.ng/math

Package Overview
Dependencies
Maintainers
1
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/math - npm Package Compare versions

Comparing version 5.2.0 to 5.3.0

2

api.d.ts

@@ -16,3 +16,3 @@ export declare const PI: number;

export declare const SQRT2_2: number;
export declare const SQRT2_3: number;
export declare const SQRT3_2: number;
export declare const THIRD: number;

@@ -19,0 +19,0 @@ export declare const TWO_THIRD: number;

@@ -16,3 +16,3 @@ export const PI = Math.PI;

export const SQRT2_2 = SQRT2 / 2;
export const SQRT2_3 = SQRT3 / 2;
export const SQRT3_2 = SQRT3 / 2;
export const THIRD = 1 / 3;

@@ -19,0 +19,0 @@ export const TWO_THIRD = 2 / 3;

# Change Log
- **Last updated**: 2021-12-13T10:26:00Z
- **Last updated**: 2022-03-11T12:13:49Z
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)

@@ -12,2 +12,8 @@

## [5.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/math@5.3.0) (2022-03-11)
#### 🚀 Features
- add ldiv() ([35d1e97](https://github.com/thi-ng/umbrella/commit/35d1e97))
## [5.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/math@5.2.0) (2021-12-13)

@@ -14,0 +20,0 @@

@@ -13,3 +13,3 @@ import type { FnN, FnN2, FnN3, FnN4, FnU3 } from "@thi.ng/api";

*
* @param x
* @param x -
*/

@@ -20,3 +20,3 @@ export declare const clamp0: FnN;

*
* @param x
* @param x -
*/

@@ -27,3 +27,3 @@ export declare const clamp01: FnN;

*
* @param x
* @param x -
*/

@@ -34,3 +34,3 @@ export declare const clamp11: FnN;

*
* @param x
* @param x -
*/

@@ -78,4 +78,4 @@ export declare const clamp05: FnN;

*
* @param a
* @param b
* @param a -
* @param b -
*/

@@ -86,5 +86,5 @@ export declare const minNonZero2: FnN2;

*
* @param a
* @param b
* @param c
* @param a -
* @param b -
* @param c -
*/

@@ -91,0 +91,0 @@ export declare const minNonZero3: FnN3;

@@ -12,3 +12,3 @@ /**

*
* @param x
* @param x -
*/

@@ -19,3 +19,3 @@ export const clamp0 = (x) => (x > 0 ? x : 0);

*
* @param x
* @param x -
*/

@@ -26,3 +26,3 @@ export const clamp01 = (x) => (x < 0 ? 0 : x > 1 ? 1 : x);

*
* @param x
* @param x -
*/

@@ -33,3 +33,3 @@ export const clamp11 = (x) => (x < -1 ? -1 : x > 1 ? 1 : x);

*
* @param x
* @param x -
*/

@@ -121,4 +121,4 @@ export const clamp05 = (x) => (x < 0 ? 0 : x > 0.5 ? 0.5 : x);

*
* @param a
* @param b
* @param a -
* @param b -
*/

@@ -129,5 +129,5 @@ export const minNonZero2 = (a, b) => a !== 0 ? (b !== 0 ? Math.min(a, b) : a) : b;

*
* @param a
* @param b
* @param c
* @param a -
* @param b -
* @param c -
*/

@@ -134,0 +134,0 @@ export const minNonZero3 = (a, b, c) => minNonZero2(minNonZero2(a, b), c);

@@ -1,7 +0,7 @@

import type { FnN, FnN2, FnN3 } from "@thi.ng/api";
import type { FnN, FnN2, FnN3, FnU2 } from "@thi.ng/api";
/**
* Returns a value with the magnitude of `x` and the sign of `y`.
*
* @param x
* @param y
* @param x -
* @param y -
*/

@@ -12,3 +12,3 @@ export declare const copysign: FnN2;

*
* @param x
* @param x -
*/

@@ -20,4 +20,4 @@ export declare const exp2: FnN;

*
* @param x
* @param y
* @param x -
* @param y -
*/

@@ -28,5 +28,5 @@ export declare const fdim: FnN2;

*
* @param x
* @param y
* @param z
* @param x -
* @param y -
* @param z -
*/

@@ -48,4 +48,4 @@ export declare const fma: FnN3;

*
* @param x
* @param y
* @param x -
* @param y -
*/

@@ -66,3 +66,3 @@ export declare const fmod: FnN2;

*
* @param x
* @param x -
*/

@@ -73,4 +73,4 @@ export declare const frexp: (x: number) => number[];

*
* @param x
* @param exp
* @param x -
* @param exp -
*/

@@ -84,6 +84,14 @@ export declare const ldexp: FnN2;

*
* @param x
* @param y
* @param x -
* @param y -
*/
export declare const remainder: FnN2;
/**
* Computes both the quotient and remainder of the integer division of the
* numerator `x` by the denominator `y`.
*
* @param x -
* @param y -
*/
export declare const ldiv: FnU2<number, [number, number]>;
//# sourceMappingURL=libc.d.ts.map
/**
* Returns a value with the magnitude of `x` and the sign of `y`.
*
* @param x
* @param y
* @param x -
* @param y -
*/

@@ -11,3 +11,3 @@ export const copysign = (x, y) => Math.sign(y) * Math.abs(x);

*
* @param x
* @param x -
*/

@@ -19,4 +19,4 @@ export const exp2 = (x) => 2 ** x;

*
* @param x
* @param y
* @param x -
* @param y -
*/

@@ -27,5 +27,5 @@ export const fdim = (x, y) => Math.max(x - y, 0);

*
* @param x
* @param y
* @param z
* @param x -
* @param y -
* @param z -
*/

@@ -47,4 +47,4 @@ export const fma = (x, y, z) => x * y + z;

*
* @param x
* @param y
* @param x -
* @param y -
*/

@@ -66,3 +66,3 @@ export const fmod = (x, y) => x % y;

*
* @param x
* @param x -
*/

@@ -88,4 +88,4 @@ export const frexp = (x) => {

*
* @param x
* @param exp
* @param x -
* @param exp -
*/

@@ -99,5 +99,18 @@ export const ldexp = (x, exp) => x * 2 ** exp;

*
* @param x
* @param y
* @param x -
* @param y -
*/
export const remainder = (x, y) => x - y * Math.round(x / y);
/**
* Computes both the quotient and remainder of the integer division of the
* numerator `x` by the denominator `y`.
*
* @param x -
* @param y -
*/
export const ldiv = (x, y) => {
x |= 0;
y |= 0;
const q = (x / y) | 0;
return [q, x - q * y];
};

@@ -80,7 +80,7 @@ import type { FnN, FnN2, FnN3, FnN4, FnN5, FnN6 } from "@thi.ng/api";

*
* @param a
* @param b
* @param c
* @param d
* @param t
* @param a -
* @param b -
* @param c -
* @param d -
* @param t -
*/

@@ -96,21 +96,20 @@ export declare const mixCubicHermiteFromPoints: FnN5;

*
* @param s00
* @param s01
* @param s02
* @param s03
* @param s10
* @param s11
* @param s12
* @param s13
* @param s20
* @param s21
* @param s22
* @param s23
* @param s30
* @param s31
* @param s32
* @param s33
* @param u
* @param v
* @returns
* @param s00 -
* @param s01 -
* @param s02 -
* @param s03 -
* @param s10 -
* @param s11 -
* @param s12 -
* @param s13 -
* @param s20 -
* @param s21 -
* @param s22 -
* @param s23 -
* @param s30 -
* @param s31 -
* @param s32 -
* @param s33 -
* @param u -
* @param v -
*/

@@ -240,4 +239,4 @@ export declare const mixBicubic: (s00: number, s01: number, s02: number, s03: number, s10: number, s11: number, s12: number, s13: number, s20: number, s21: number, s22: number, s23: number, s30: number, s31: number, s32: number, s33: number, u: number, v: number) => number;

*
* @param k
* @param t
* @param k -
* @param t -
*/

@@ -253,4 +252,4 @@ export declare const sinc: FnN;

*
* @param k
* @param t
* @param k -
* @param t -
*/

@@ -265,4 +264,4 @@ export declare const sincNormalized: FnN2;

*
* @param a
* @param t
* @param a -
* @param t -
*/

@@ -314,5 +313,5 @@ export declare const lanczos: FnN2;

*
* @param a
* @param b
* @param num
* @param a -
* @param b -
* @param num -
*/

@@ -326,7 +325,7 @@ export declare const expFactor: FnN3;

*
* @param bias
* @param sigma
* @param t
* @param bias -
* @param sigma -
* @param t -
*/
export declare const gaussian: FnN3;
//# sourceMappingURL=mix.d.ts.map

@@ -105,7 +105,7 @@ import { EPS, HALF_PI, PI } from "./api.js";

*
* @param a
* @param b
* @param c
* @param d
* @param t
* @param a -
* @param b -
* @param c -
* @param d -
* @param t -
*/

@@ -129,21 +129,20 @@ export const mixCubicHermiteFromPoints = (a, b, c, d, t) => {

*
* @param s00
* @param s01
* @param s02
* @param s03
* @param s10
* @param s11
* @param s12
* @param s13
* @param s20
* @param s21
* @param s22
* @param s23
* @param s30
* @param s31
* @param s32
* @param s33
* @param u
* @param v
* @returns
* @param s00 -
* @param s01 -
* @param s02 -
* @param s03 -
* @param s10 -
* @param s11 -
* @param s12 -
* @param s13 -
* @param s20 -
* @param s21 -
* @param s22 -
* @param s23 -
* @param s30 -
* @param s31 -
* @param s32 -
* @param s33 -
* @param u -
* @param v -
*/

@@ -290,4 +289,4 @@ export const mixBicubic = (s00, s01, s02, s03, s10, s11, s12, s13, s20, s21, s22, s23, s30, s31, s32, s33, u, v) => mixCubicHermiteFromPoints(mixCubicHermiteFromPoints(s00, s01, s02, s03, u), mixCubicHermiteFromPoints(s10, s11, s12, s13, u), mixCubicHermiteFromPoints(s20, s21, s22, s23, u), mixCubicHermiteFromPoints(s30, s31, s32, s33, u), v);

*
* @param k
* @param t
* @param k -
* @param t -
*/

@@ -303,4 +302,4 @@ export const sinc = (t) => (t !== 0 ? Math.sin(t) / t : 1);

*
* @param k
* @param t
* @param k -
* @param t -
*/

@@ -315,4 +314,4 @@ export const sincNormalized = (k, t) => sinc(PI * k * t);

*
* @param a
* @param t
* @param a -
* @param t -
*/

@@ -366,5 +365,5 @@ export const lanczos = (a, t) => t !== 0 ? (-a < t && t < a ? sinc(PI * t) * sinc((PI * t) / a) : 0) : 1;

*
* @param a
* @param b
* @param num
* @param a -
* @param b -
* @param num -
*/

@@ -378,6 +377,6 @@ export const expFactor = (a, b, num) => (b / a) ** (1 / num);

*
* @param bias
* @param sigma
* @param t
* @param bias -
* @param sigma -
* @param t -
*/
export const gaussian = (bias, sigma, t) => Math.exp(-((t - bias) ** 2) / (2 * sigma * sigma));
{
"name": "@thi.ng/math",
"version": "5.2.0",
"version": "5.3.0",
"description": "Assorted common math functions & utilities",

@@ -37,11 +37,11 @@ "type": "module",

"dependencies": {
"@thi.ng/api": "^8.3.3"
"@thi.ng/api": "^8.3.4"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.19.2",
"@thi.ng/testament": "^0.2.3",
"@microsoft/api-extractor": "^7.19.4",
"@thi.ng/testament": "^0.2.4",
"rimraf": "^3.0.2",
"tools": "^0.0.1",
"typedoc": "^0.22.10",
"typescript": "^4.5.3"
"typedoc": "^0.22.13",
"typescript": "^4.6.2"
},

@@ -136,3 +136,3 @@ "keywords": [

},
"gitHead": "2db9dd34c0c2c60cbfde3dad0bca352b20292f5c\n"
"gitHead": "0fc692a3225c068aacafdc4cb6140cf603c67ad8\n"
}

@@ -8,3 +8,3 @@ /**

*
* @param x
* @param x -
*/

@@ -19,5 +19,5 @@ export declare function primesUntil(x: number): Generator<number, void, unknown>;

*
* @param x
* @param x -
*/
export declare const nearestPrime: (x: number) => number;
//# sourceMappingURL=prime.d.ts.map

@@ -8,3 +8,3 @@ /**

*
* @param x
* @param x -
*/

@@ -31,3 +31,3 @@ export function* primesUntil(x) {

*
* @param x
* @param x -
*/

@@ -34,0 +34,0 @@ export const nearestPrime = (x) => {

@@ -74,3 +74,3 @@ <!-- This file is generated - DO NOT EDIT! -->

Package sizes (gzipped, pre-treeshake): ESM: 4.11 KB
Package sizes (gzipped, pre-treeshake): ESM: 4.29 KB

@@ -129,2 +129,2 @@ ## Dependencies

&copy; 2013 - 2021 Karsten Schmidt // Apache Software License 2.0
&copy; 2013 - 2022 Karsten Schmidt // Apache Software License 2.0

@@ -5,6 +5,6 @@ import type { FnN2 } from "@thi.ng/api";

*
* @param a
* @param b
* @param a -
* @param b -
*/
export declare const safeDiv: FnN2;
//# sourceMappingURL=safe-div.d.ts.map
/**
* Returns `a` divided by `b` or zero if `b = 0`.
*
* @param a
* @param b
* @param a -
* @param b -
*/
export const safeDiv = (a, b) => (b !== 0 ? a / b : 0);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc