HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

3- 26
= -13 - (-14)
= -13 + 14
= 1
-13 MOD -2 = -13 - (-2*INT(-13/-2))
= -13 - (-2*6)
= -13 - (-12)
= -13 +12
= -1
3 MOD 5 = 3 - (5*INT(3/5))
= 3 - (5*0)
= 3 - 0
= 3
Relational Operators
A relational operator has either two numeric operands, two ASCII string
operands, or the result of another relational expression and a Boolean
result. Every relational operator is binary.
Table 3-21 gives the name and an example of each relational operator.
Table 3-21. Relational Operators
---------------------------------------------------------------------------------------------
|| | |
| Operator | Operation Name | Example (expression=result) |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| < | Less Than | (1<2)=TRUE |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| <= | Less Than or Equal | (2<=1)=FALSE |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| = | Equal | (9=7)=FALSE |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| >= | Greater Than or Equal | (9>=4)=TRUE |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| <> | Not Equal | (36<>45)=TRUE |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| # | Not Equal | 12#(6+6)=FALSE |
|| | |
---------------------------------------------------------------------------------------------
String Comparisons. String comparisons are made by comparing each
string operand character by character from left to right. The charac-
ters are compared based on each character's ordinal value in the ASCII
character set. The ordinal value of a character is the value in the
decimal code column in the ASCII character code table presented in Ap-
pendix D. To compare two strings when using a native language other than
NATIVE-3000(language #0), the language the system uses before the
introduction of Native Language Support, use the LEX function (for more
information on Native Language Support refer to "Native Language Sup-
port" in chapter 6, or the
Native Language Programmer's Guide
).