Return the sum of the arguments
| Input Stack | Output Stack | ||
|---|---|---|---|
| Num1 | Num2 | → | Num3 |
| Num1 | Z2 | → | Z3 |
| Num1 | ∡2 | → | ∡3 |
| Num1 | A2 | → | 'Num1 + A2' |
| Z1 | Z2 | → | Z3 |
| Z1 | Num2 | → | Z3 |
| Z1 | ∡2 | → | Z3 |
| Z1 | A2 | → | 'Z1 + A2' |
| ∡1 | ∡2 | → | ∡3 |
| ∡1 | Num2 | → | ∡3 |
| ∡1 | Z2 | → | Z3 |
| ∡1 | A2 | → | '∡1 + A2' |
| A1 | A2 | → | 'A1 + A2' |
| A1 | Num2 | → | 'A1 + Num2' |
| A1 | Z2 | → | 'A1 + Z2' |
| A1 | U2 | → | 'A1 + U2' |
| A1 | ∡2 | → | 'A1 + ∡2' |
| U1 | U2 | → | U3 |
| U1 | A2 | → | 'U1 + A2' |
| M1 | M2 | → | M3 |
| V1 | V2 | → | V3 |
| S1 | S2 | → | “S1S2“ |
| S1 | O2 | → | “S1O2“ |
| O1 | S2 | → | “O1S2“ |
| Level 2 / Argument 1 | Level 1 / Argument 2 | → | Level 1 |
In general if the arguments of the sum have the same type so will do the result. However same data types may have different sub-types; in this case the following coercion rules apply:
0 the result will be coerced to real type;If the arguments of the sum have different type the following rules apply:
0: in this case the result will be coerced to real type;BADD if truncation to wordsize is desired;The sum between two matrices or two vectors is done element by element: for each couple of elements the rules above are applied.
Occurrence of underflow, overflow or infinite result will raise an error if one of the corresponding flags from -20 to -22 is cleared.
If on the contrary one or more of these flags is set, no error will be raised and the matching indicator flag from -23 to -26 will be set.
This command is only partially compatible with userRPL.
In particular:
+ operator does not concatenate or extend lists anymore: use ADD instead.2: #120o 1: #3h …………………………………………………………………………………… +
returns #123o.
2: (1, ∡60°) 1: 5 …………………………………………………………………………………… +
returns (5.5678., ∡8.9483.°).
2: "Hello " 1: "world!" …………………………………………………………………………………… +
returns “Hello world!”.
2: 1_h 1: 36_min …………………………………………………………………………………… +
returns 1.6_h.
2: [ 1 2 ] 1: [ 1 0 ] …………………………………………………………………………………… +
returns [ 2 2 ].
2: 'X' 1: 'Y' …………………………………………………………………………………… +
returns 'X+Y'.
| Operator | Short Description | |
|---|---|---|
| Evaluation operators: | ||
| EVAL1 | Evaluate one level | NEW |
| EVAL | Evaluate full depth | |
| XEQ | Execute | NEW |
| →NUM | Compute numeric result | |
| Test operators: | ||
| == | Equality test | |
| ≠ | Not equal test | |
| < | Less than test | |
| ≤ | Less than or equal test | |
| > | Greater than test | |
| ≥ | Greater than or equal test | |
| CMP | Comparison test (<0 if A<B, 0 if A==B, >0 if A>B) | NEW |
| SAME | Comparison test, true if objects are the same | |
| ISTRUE | True test | NEW |
| Logical operators: | ||
| AND | Logical AND | |
| OR | Logical OR | |
| XOR | Logical XOR | |
| NOT | Logical NOT | |
| Mathematic operators: | ||
| + | Addition | |
| - | Subtraction | |
| * | Multiplication | |
| / | Division | |
| ^ | Power | |
| XROOT | Root | |
| INV | Inverse | |
| NEG | Negate/change sign | |
| ABS | Magnitude or absolute value | |