API reference@evolu/common › Number

Number arithmetic, comparison, and branded numeric types.

Functions

FunctionDescription
clampClamps a number within a given range.
computeBalancedBucketsDivides items into buckets as evenly as possible, ensuring each bucket has at least the minimum number of items. Returns a success result if the minimum is met, or an error result with the required number of items if not.
decrement-
fibonacciAtReturns the Fibonacci number at the given index (1-indexed: 1,1,2,3,5,8,...).
increment-
isBetweenCreates a predicate that checks if a number is within a range, inclusive.
maxReturns the maximum value, preserving branded type if applicable.
minReturns the minimum value, preserving branded type if applicable.

Type Aliases

Type AliasDescription
FibonacciIndexValid index for fibonacciAt, constrained to 1-78.

Variables

VariableDescription
FibonacciIndexValid index for fibonacciAt, constrained to 1-78.