IBM 5100 Basic Reference Manual page 56

Hide thumbs Also See for 5100:
Table of Contents

Advertisement

52
The positive/negative operators are:
+
Positive
Negative
Special rules for the arithmetic operators and the resulting actions are as follows:
Exponentiation:
The expression A tB is defined as the variable A raised to the
B power.
1.
If A=B=O, an error will occur.
2.
If A=O and B<O, an error will occur.
3.
If A<O and B is not an integer, an error of a negative number to a fractional
power will occur.
4.
If A=I=O and B=O, AtB is evaluated as 1,
5.
If A=O and B>O, AtB is evaluated as O.
Multiplication and Addition:
A*B and A+B, multiplication and addition respectively,
are both commutative; in other words, A*B=B*A and A+B=B+A. However, multi-
plication and addition are not always associative because of low-order rounding
errors; for example, A*(B*C) does not necessarily give the same results as (A*B)*C.
Division:
A/B is defined as A divided by B. If 8=0, an error (overflow) will occur.
Subtraction:
A-B is defined as A minus B. No special conditions exist.
Positive/Negative Operators:
The + and - signs can also be used as positive/negative
operators; which can be used in only two situations:
1.
Following a left parenthesis and preceding an arithmetic expression.
2.
As the leftmost character in an entire arithmetic expression that is not
preceded by an operator.
For example:
-A+(-B) and B-(-2) are valid.
A+-B or 8--2 are invalid.

Advertisement

Table of Contents
loading

Table of Contents