export * from './number'; export * from './safeDiv'; /** Extended Math */ export declare namespace MathEx { /** `2π` */ const PI2 = 6.283185307179586; /** `180 ÷ π` */ const DEG_PER_RAD = 57.29577951308232; /** `π ÷ 180` */ const RAD_PER_DEG = 0.017453292519943295; /** √1 */ const Sqrt1 = 1; /** √2 */ const Sqrt2 = 1.4142135623730951; /** √3 */ const Sqrt3 = 1.7320508075688772; /** √4 */ const Sqrt4 = 2; /** √5 */ const Sqrt5 = 2.23606797749979; /** √6 */ const Sqrt6 = 2.449489742783178; /** √7 */ const Sqrt7 = 2.6457513110645907; /** √8 */ const Sqrt8 = 2.8284271247461903; /** √9 */ const Sqrt9 = 3; /** √10 */ const Sqrt10 = 3.1622776601683795; /** ϕ | φ */ const GoldenRatio = 1.618033988749895; /** K */ const Khinchin = 2.6854520010653062; /** λ */ const Conway = 1.3035772690342964; /** C10 */ const Champernowne = 0.12345678910111213; /** γ */ const Euler = 0.5772156649015329; /** Get absolute value */ function abs(value: number): number; /** Get absolute value */ function abs(value: bigint): bigint; /** Find the smallest number */ function min(a: number, ...args: number[]): number; /** Find the smallest number */ function min(a: bigint, ...args: bigint[]): bigint; /** Find the largest number */ function max(a: number, ...args: number[]): number; /** Find the largest number */ function max(a: bigint, ...args: bigint[]): bigint; /** Power */ function pow(base: number, exponent: number): number; /** Power */ function pow(base: bigint, exponent: bigint): bigint; /** Remap numbers from a range to another range */ function remap(value: number, inLow: number, inHigh: number, outLow: number, outHigh: number): number; /** Remap numbers from a range to another range */ function remap(value: bigint, inLow: bigint, inHigh: bigint, outLow: bigint, outHigh: bigint): bigint; /** Limit number range, numbers outside the range will be cropped */ function clamp(value: number, lower: number, upper: number): number; /** Limit number range, numbers outside the range will be cropped */ function clamp(value: bigint, lower: bigint, upper: bigint): bigint; /** Degrees to Radians */ function radians(degrees: number): number; /** Radians to Degrees */ function degrees(radians: number): number; /** Positive number returns `1`, Negative number returns `-1` * - `n` => `1` * - `-n` => `-1` * - `0` => `1` * -`-0` => `-1` * - `NaN` => `NaN` */ function unit(value: number): -1 | 1; /** Negative number returns `-1`, other returns `1` * - `n` => `1` * - `-n` => `-1` * - `0` => `1` */ function unit(value: bigint): -1n | 1n; /** Returns the sign of the x, indicating whether x is positive, negative or zero. * - `n` => `1` * - `-n` => `-1` * - `0` => `0` * - `-0` => `-0` * - `NaN` => `NaN` */ function sign(value: number): -1 | 1 | 0 | -0; /** Returns the sign of the x, indicating whether x is positive, negative or zero. * - `n` => `1` * - `-n` => `-1` * - `0` => `0` */ function sign(value: bigint): -1n | 1n | 0n; /** Compare 2 numbers * - `a > b` => `1` * - `a < b` => `-1` * - `a == b` => `0` */ function cmp(a: number, b: number): -1 | 0 | 1; /** Compare 2 numbers * - `a > b` => `1` * - `a < b` => `-1` * - `a == b` => `0` */ function cmp(a: bigint, b: bigint): -1n | 0n | 1n; } /** Fibonacci sequence in `O(1)` */ export declare function fibonacci(n: number): number; /** Fibonacci sequence in `O(2ⁿ)` */ export declare function fibonacciRecur(n: number): number; export declare function fibonacciRecur(n: bigint): bigint; /** Fibonacci sequence in `O(n)` */ export declare function fibonacciTailRecur(n: number): number; export declare function fibonacciTailRecur(n: bigint): bigint; /** Fibonacci sequence in `O(n)` */ export declare function fibonacciLoop(n: number): number; export declare function fibonacciLoop(n: bigint): bigint;