<
"Less than" operator.
Syntax
expr_1 < expr_2
Operands
- expr_1, expr_2
- A pair of valid scalar expressions, at least one of which must be scalar.
Example
Expression | Result |
---|---|
0 < 3
|
1 |
1 < -1
|
0 |
0 < 0
|
0 |
0 < {-1, 0, 1}
|
{0, 0, 1}
|
{-1, 0, 1} < 0
|
{1, 0, 0}
|
3 < {{1, 2, 3}, {2, 4, 6}}
|
{{0, 0, 0}, {0, 1, 1}}
|
{{1, 2, 3}, {2, 4, 6}} < 3
|
{{1, 1, 0}, {1, 0, 0}}
|
Comments
The result is a scalar.
If the value of expr_1 is strictly less than the value expr_2, the result is one.
If the value of expr_1 is greater than or equal to the value expr_2, the result is zero.
It is possible for either expr_1 or expr_2 to be a vector or a matrix, but one must be a scalar.
If expr_1 is a vector, and expr_2 is a scalar, then the result will be a vector whose values will be 0 if the corresponding elements of expr_1 are strictly less than expr_2, and 1 otherwise. The result vector will have the same number of elements as the original vector.
If expr_1 is a scalar, and expr_2 is a vector, then the result will be a vector whose values will be 0 if the corresponding elements of expr_2 are greater than or equal to expr_1, and 1 otherwise. The result vector will have the same number of elements as the original vector.
If expr_1 is a matrix, and expr_2 is a scalar, then the result will be a matrix whose values will be 0 if the corresponding elements of expr_1 are strictly less than expr_2, and 1 otherwise. The result matrix will have the same number of rows and columns as the original matrix.
If expr_1 is a scalar, and expr_2 is a matrix, then the result will be a matrix whose values will be 0 if the corresponding elements of expr_2 are greater than or equal to expr_1, and 1 otherwise. The result matrix will have the same number of rows as the original matrix.