Specifications
Concepts - 11
The NOT operator performs a logical negative of a value.
Operand 1 0001 0111 = 23
NOT Operand 1 1110 1000 = 232
Value of expression Value of NOT expression
1 –2
2 –3
–2 1
–1 0
NOTE: The NOT expression is false only if the expression evaluates to a value of –1. If you define Boolean
constants or variables for use in your programs, use –1 for true.
The XOR operator essentially detects the presence of a binary “1” in either operand. For example:
Operand 1 0001 0111 = 23
Operand 2 0100 1010 = 74
Operand 1 0101 1101 = 93
XOR Operand 2
Expression Evaluation
Parenthesis
The usual rules for order are followed in evaluating expressions. The order of evaluation is controlled by parentheses.
Their liberal use is recommended both for error–free code and for clarity. They are required when mixing functional,
mathematical, logical or relational operators.
Spaces
CAMBASIC has a very forgiving attitude towards the use of spaces. They may be used almost anywhere. They must be
used after keywords. If the keyword is followed by a variable, for example, PRINTF, will give a syntax error. All spaces
are removed in the compiling process. They are added back when you type LIST.
Order
The set of arithmetic and logical operators available in CAMBASIC in the order in which they are evaluated is as follows:
1. expressions in parentheses “( )”
2. ˆ (exponentiation)
3. – (unary minus)
4. * and / (multiplication and division)
5. + and – (addition and subtraction)
6. relational operators
= (equal)
<> (not equal)
< (less than)
> (greater than)
<= (less than or equal to)










