SmallerEqual

SmallerEqual

a <= b represents the mathematical 'smaller than or equal to' relation. Use a <== b to check it in a script.

Usages

a <= b or SmallerEqual[ a, b ]

a <= b represents the inequality a ≤ b, for example in a definition or an answer. In a script, it is not checked: 2 <= 4 stays 2 <= 4. It is checked when it is used as a condition in If or While, or inside Simplify.

Example in rendered
The inequality x ≤ 4. x <= 4 or SmallerEqual[ x, 4 ] x≤4x \le 4
Example in out
Not checked in a script. 2 <= 4 2 <= 4
Checked inside Simplify. Simplify[ 2 <= 4 ] True
Checked as a condition. a := 5
If[a <= 4]
  r := 1
Else
  r := 0
End
r = 0

a <== b or SmallerEqualEval[ a, b ]

a <== b checks directly whether the value of a is smaller than or equal to the value of b, and returns True or False. If one of the values is not known, the comparison is left unevaluated.

Example in out
4 is equal to 4. 4 <== 4 True
5 is larger than 4. 5 <== 4 False
Each element of a list is compared. {1, 5} <== 4 {True, False}
Cannot be decided. x <== 4 x <== 4
Details
  • Note the notation: <== with two = signs. <<= is not valid syntax.
  • Greater than or equal to: see GreaterEqual for a >= b and a >== b.

See also: Smaller, GreaterEqual, EqualsEval, If