HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
3- 24
||||
---------------------------------------------------------------------------------------------
||||
| Arithmetic | Numeric | Numeric |
||||
---------------------------------------------------------------------------------------------
||||
| Relational | Numeric or string | Boolean* |
||||
---------------------------------------------------------------------------------------------
||||
| Boolean | Boolean* | Boolean* |
||||
---------------------------------------------------------------------------------------------
||||
| String | String | String |
||||
---------------------------------------------------------------------------------------------
Table 3-19 Note
* A Boolean value is actually a numeric value. TRUE is one and FALSE
is zero.
Arithmetic Operators
An arithmetic operator has numeric operands and a numeric result.
Table 3-20 identifies each arithmetic operator as unary or binary and
gives its name and an example.
Table 3-20. Arithmetic Operators
---------------------------------------------------------------------------------------------
||| | |
| Operator | Unary | Operation Name | Example |
||or ||(expression=result) |
||Binary |||
||| | |
---------------------------------------------------------------------------------------------
||| | |
| + | Unary | Unary plus | +5=5 |
||| | |
---------------------------------------------------------------------------------------------
||| | |
| + | Binary | Addition | 1+2=3 |
||| | |
---------------------------------------------------------------------------------------------
||| | |
| - | Unary | Unary minus | -(4+4)=-8 |
||| | |
---------------------------------------------------------------------------------------------
||| | |
| - | Binary | Subtraction | 8-4=4 |
||| | |
---------------------------------------------------------------------------------------------
||| | |
| * | Binary | Multiplication | 9*7=63 |
||| | |
---------------------------------------------------------------------------------------------
||| | |
| / | Binary | Real division | 36/4=9.0 |
||| | |
---------------------------------------------------------------------------------------------
||| | |
| DIV | Binary | Integer division | 37 DIV 4=9 |
||| | |
---------------------------------------------------------------------------------------------
||| | |