Returns the absolute value of an integer.
The result is non-negative and keeps the Int brand. Note that
Math.abs(Number.MIN_SAFE_INTEGER) exceeds Number.MAX_SAFE_INTEGER, so
use SafeInt for guaranteed precision.
Adds two integers, returning a + b as an Int.
Divides two integers using floor division (⌊a / b⌋): the result is a / b rounded toward negative infinity, as an Int.
Type guard that checks if a value is an integer.
isInt for usage examples
Readonlymax: (...values: readonly WithSmallInt<Int>[]) => IntReturns the largest of the given integers.
Readonlymin: (...values: readonly WithSmallInt<Int>[]) => IntReturns the smallest of the given integers.
Multiplies two integers, returning a * b as an Int.
Raises a to the power b, returning a ** b as an Int (floored to an
integer).
Generates a random Int within the given range.
The range is inclusive on both ends.
Subtracts two integers, returning a - b as an Int.
Namespace providing type-safe operations for the
Intbranded type.The
Inttype represents an integer. Division (div) uses floor division.Unlike
SafeInt,Intallows values outside the safe integer range (±2^53 − 1), so very large magnitudes may lose precision in JavaScript'snumbertype.