The comparison operators can only be used on data of the same type. Table 4.6 shows the list of operators for numeric format data. Similarly, the operators shown in the table below can be applied to character format, date format, time format data.
Details of comparison |
Format |
Example |
Equal |
|
1.5==1.5(0b1), "abc"=="abcd" (0b0) |
Not equal |
|
1.5!=1.5(0b0), "abc"=="abcd" (0b1) |
Greater than |
|
10>5(0b1), "abc">"abcd" (0b0) |
Less than |
|
10<5(0b0), "abc"<"abcd" (0b1) |
Above |
|
10>=10(0b1), "a">"" (0b1) |
Below |
|
8<=9(0b1), "a"<="a" (0b1) |