Note: information on this page refers to Ceylon 1.2, not to the current release.
<=
(less than or equal) operator
The non-associating, binary infix <=
operator is used to test whether its left-hand
operand is less than or equal to its right-hand operand.
Usage
void m<T>(T x, T y)
given T satisfies Comparable<T> {
Boolean lessOrEqual = x <= y;
}
Description
Definition
The <=
operator is defined as follows:
lhs.compare(rhs)!=larger;
See the language specification for more details.
Polymorphism
The <=
operator is polymorphic.
The meaning of <=
depends on the
Comparable
interface.
Type
The result type of the <=
operator is Boolean
.
See also
- API documentation for
Comparable
<=
in the language specification- operator precedence in the language specification
- Operator polymorphism in the Tour of Ceylon