API Reference / @evolu/common / Number
Number
Functions
Function | Description |
---|---|
clamp | Clamps a number within a given range. |
computeBalancedBuckets | Divides 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 | - |
increment | - |
isBetween | Creates a predicate that checks if a number is within a range, inclusive. |
max | Returns the maximum value, preserving branded type if applicable. |
min | Returns the minimum value, preserving branded type if applicable. |