LessEqual¶
Status: Stable
documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
Description¶
x \<= y or LessEqual[x, y] yields True if x is less than or equal to y on numeric inputs, False if strictly greater, otherwise unevaluated. Per IEEE 754, an Indeterminate argument gives False.
Examples (3)¶
Every input below was run against the current Mathilda build and its output recorded.
Applications (3)¶
Implementation notes¶
builtin_lessequal delegates to evaluate_inequality(res, -1, 0): it walks adjacent argument pairs through compare_numeric (exact GMP for integer-like operands, exact cross-multiplied long double for rationals, 2^-46 relative tolerance for inexact reals) and accepts a pair when the sign is in {-1, 0} (less-than-or-equal). All pairs satisfying ≤ → True; any pair comparing +1 → False; any non-comparable symbolic pair → NULL (left unevaluated). Implements chained a <= b <= c. Same implementation as Less/Greater/GreaterEqual with a different accepted-sign set.
Attributes: Protected.
References¶
- Source:
src/comparisons.c - Specification:
docs/spec/builtins/comparisons.md - Tests:
tests/test_comparisons.c - Tests:
tests/test_reduce.c - Tests:
tests/test_solve.c
Notes & additional examples¶
Notes¶
<= is the operator form of LessEqual. It returns True when the arguments are equal, and False only when the left side is strictly greater.