Const
Returns the absolute value of a finite number.
Adds two finite numbers.
Returns the smallest integer greater than or equal to the given finite number.
Divides two finite numbers.
The divisor must be non-zero (enforced by type constraints). The result is guaranteed to be finite when both inputs are finite and the divisor is non-zero.
Returns the largest integer less than or equal to the given finite number.
Type guard that checks if a value is a finite number.
isFiniteNumber for usage examples
Readonly
max: (...values: readonly FiniteNumber[]) => FiniteNumberReturns the maximum value from a list of finite numbers.
Readonly
min: (...values: readonly FiniteNumber[]) => FiniteNumberReturns the minimum value from a list of finite numbers.
Multiplies two finite numbers.
Raises a finite number to a power.
Generates a random finite number within the specified range.
The generated value is uniformly distributed in the range [min, max]. Both bounds are inclusive.
Rounds a finite number to the nearest integer.
Subtracts two finite numbers.
Namespace providing type-safe operations for FiniteNumber branded types.
The FiniteNumber type represents any finite numeric value, excluding the special values NaN, Infinity, and -Infinity. All operations are guaranteed to maintain the finite constraint when given finite inputs.
This type is essential for: