Description:
Compare two numerical values, sequences, characters or serial bytes.
Syntax:
x==y |
If values of two operands are equal, the result is true. Otherwise, it is false. |
x! =y |
If values of two operands are not equal, the result is true. Otherwise, it is false. |
x<y |
If x is less than y, the result is true. Otherwise, it is false. |
x>y |
If x is greater than y, the result is true. Otherwise, it is false. |
x<=y |
If x is less than or equal to y, the result is true. Otherwise, it is false. |
x>=y |
If x is greater than or equal to y, the result is true. Otherwise, it is false. |
Note:
The comparison operation requires data type of the operands to be numerical, sequence, serial byte or character, and returns a Boolean result.
If x/y are sequences, then x and y will be compared in one-to-one relationship in the sequential order of members. Return the result according to the relationship of first pair of unequal members undergoing the alignment comparison. Return true if the conditions are met; Otherwise, return false. However, for the comparison operator == used for alignment comparison, the true will only be returned when all members are equal. Otherwise, return false. If the numbers of members in sequences x and y are not the same, and those compared members are the same, then the one with fewer members is smaller.
If x/y are serial bytes, the comparison starts from the first byte and stops if the the first pair of different bytes appears. Return true if the conditions are met; Otherwise, return false. Relational operators include >, >=, <, <=. x and y need to have the same number of bytes; otherwise, they are incomparable.
Parameter:
x/y |
Sequence, numerical, character data or serial bytes. |
Return value:
Boolean
Example:
|
A |
|
1 |
=2==3 |
false |
2 |
=2!=5 |
true |
3 |
=2>5 |
false |
4 |
=10<5 |
false |
5 |
=2<=3 |
true |
6 |
=3>=4 |
false |
7 |
="a"=="b" |
false |
8 |
=[5,2,1,2]<[5,2,1,2,-3] |
true |
9 |
=k(1)==k(1:2) |
false |
10 |
=k(3)!=k(1:2) |
true |
11 |
=k(1:2)<k(3:2) |
true |
12 |
=k(1:2)>k(3:2) |
false |
13 |
=k(2:2)<=k(1:2) |
false |
14 |
=k(2:2)>=k(1:2) |
true |