import { Fn, PartialApply, unset, _ } from "../core/Core"; import * as Impl from "./impl/numbers"; export declare namespace Numbers { /** * Add two numbers together * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number * @returns the sum of the two numbers * @example * ```ts * type T0 = Call>; // 3 * type T1 = Call>; // 1000000000000000000000000001n * ``` */ export type Add = PartialApply; interface AddFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.Add : never; } /** * Subtract two numbers * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number to subtract from the first * @returns the difference of the two numbers * @example * ```ts * type T0 = Call>; // -1 * type T1 = Call>; // 999999999999999999999999999n * ``` */ export type Sub = PartialApply; interface SubFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.Sub : never; } /** * Multiply two numbers together * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number * @returns the product of the two numbers * @example * ```ts * type T0 = Call>; // 297 * type T1 = Call>; // 1999999999999999999999999998n * ``` */ export type Mul = PartialApply; interface MulFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.Mul : never; } /** * Divide two numbers * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number to divide the first by * @returns the quotient of the two numbers * @example * ```ts * type T0 = Call>; // 33 * type T1 = Call>; // 249999999999999999999999999n * ``` */ export type Div = PartialApply; interface DivFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.Div : never; } /** * Modulo of two numbers * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number to divide the first by * @returns the remainder of the two numbers * @example * ```ts * type T0 = Call>; // 1 * type T1 = Call>; // 3n * ``` */ export type Mod = PartialApply; interface ModFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.Mod : never; } /** * Negate a number * @description the number can be of different types (bigint or number) and handle really large numbers * @param n - the number to negate * @returns the negated number * @example * ```ts * type T0 = Call>; // -1 * type T1 = Call>; // -999999999999999999999999999n * ``` */ export type Negate = PartialApply; interface NegateFn extends Fn { return: this["args"] extends [infer a extends number | bigint, ...any] ? Impl.Negate : never; } /** * Absolute value of a number * @description the number can be of different types (bigint or number) and handle really large numbers * @param n - the number to get the absolute value of * @returns the absolute value of the number * @example * ```ts * type T0 = Call>; // 1 * type T1 = Call>; // 999999999999999999999999999n * ``` */ export type Abs = PartialApply; export interface AbsFn extends Fn { return: this["args"] extends [infer a extends number | bigint, ...any] ? Impl.Abs : never; } /** * Returns the max between 2 numbers. * @param n1 - first number or bigint * @param n2 - second number or bigint * @returns the maximum values between the two * @example * ```ts * type T0 = Call>; // 2 * ``` */ export type Max = PartialApply; export interface MaxFn extends Fn { return: Impl.Max, Extract>; } /** * Returns the min between 2 numbers. * @param n1 - first number or bigint * @param n2 - second number or bigint * @returns the minimum values between the two * @example * ```ts * type T0 = Call>; // 1 * ``` */ export type Min = PartialApply; export interface MinFn extends Fn { return: Impl.Min, Extract>; } /** * Power of a number * @description the number can be of different types (bigint or number) and handle really large numbers * @param n1 - the base number * @param n2 - the exponent * @returns the power of the two numbers * @example * ```ts * type T0 = Call>; // 340282366920938463463374607431768211456 * ``` */ export type Power = PartialApply; interface PowerFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.Power : never; } /** * Compare two numbers * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number to compare the first to * @returns -1 if n1 < n2, 0 if n1 === n2, 1 if n1 > n2 * @example * ```ts * type T0 = Call>; // -1 * type T1 = Call>; // 1 * type T2 = Call>; // 0 * ``` */ export type Compare = PartialApply; interface CompareFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.Compare : never; } /** * Check if two numbers are equal * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number to compare the first to * @returns true if n1 === n2, false otherwise * @example * ```ts * type T0 = Call>; // false * type T1 = Call>; // true * ``` */ export type Equal = PartialApply; interface EqualFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.Equal : never; } /** * Check if two numbers are not equal * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number to compare the first to * @returns true if n1 !== n2, false otherwise * @example * ```ts * type T0 = Call>; // true * type T1 = Call>; // false * ``` */ export type NotEqual = PartialApply; interface NotEqualFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.NotEqual : never; } /** * Check if a number is less than another * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number to compare the first to * @returns true if n1 < n2, false otherwise * @example * ```ts * type T0 = Call>; // true * type T1 = Call>; // false * type T2 = Call>; // false * ``` */ export type LessThan = PartialApply; interface LessThanFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.LessThan : never; } /** * Check if a number is less than or equal to another * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number to compare the first to * @returns true if n1 <= n2, false otherwise * @example * ```ts * type T0 = Call>; // true * type T1 = Call>; // true * type T2 = Call>; // false * ``` */ export type LessThanOrEqual = PartialApply; interface LessThanOrEqualFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.LessThanOrEqual : never; } /** * Check if a number is greater than another * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number to compare the first to * @returns true if n1 > n2, false otherwise * @example * ```ts * type T0 = Call>; // false * type T1 = Call>; // false * type T2 = Call>; // true * ``` */ export type GreaterThan = PartialApply; interface GreaterThanFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.GreaterThan : never; } /** * Check if a number is greater than or equal to another * @description the two numbers can be of different types (bigint or number) and handle really large numbers * @param n1 - the first number * @param n2 - the second number to compare the first to * @returns true if n1 >= n2, false otherwise * @example * ```ts * type T0 = Call>; // false * type T1 = Call>; // true * type T2 = Call>; // true * ``` */ export type GreaterThanOrEqual = PartialApply; interface GreaterThanOrEqualFn extends Fn { return: this["args"] extends [ infer a extends number | bigint, infer b extends number | bigint, ...any ] ? Impl.GreaterThanOrEqual : never; } export {}; }