smallerEq

x <= y

smallerEq(x, y)

Try it yourself:


smallerEq(): Less Than or Equal To

smallerEq() tests an inclusive upper bound. It returns true when the first value is less than or equal to the second, making it useful for limits and allowed ranges.

Inclusive comparisons

Use smaller() when equality should fail and largerEq() for a closed lower bound. Combine tests with and() to validate a range.

Ensure units are comparable, using to() where necessary. For calculated decimals, establish a tolerance instead of relying on formatting.

All functions