expr-eval icon indicating copy to clipboard operation
expr-eval copied to clipboard

Add `clamp` function

Open mck opened this issue 2 years ago • 0 comments

This commit adds a new function ´clamp´ to the codebase. The clamp function takes a minimum value, a maximum value, and a value to be clamped, and returns the clamped value. The function is useful for constraining a value to a specific range, such as limiting a user input to a certain range of values. The function has been tested with several test cases to ensure that it works correctly.

mck avatar Feb 24 '23 21:02 mck