Sub
arithmetic-functions subtract(-)
syntax
- sub(a, b)
- a - b
definition
sub(a, b) or a - b results in the element-by-element subtraction of the values of data-item b from the corresponding values of data item a.
If the result of the subtraction exceeds the MinValue or MaxValue of the value-type, an error is generated. Use the sub_or_null function if a null value is requested in these cases.
applies to
Data items with Numeric or Point value-type
conditions
- Domain units of the arguments must match or be void (literals or parameters can be subtracted from data items of any domain).
- Arguments must have matching:
example
1. attribute<float32> AminB (ADomain) := sub(A, B);
2. attribute<float32> AminB (ADomain) := A - B;
A | B | AminB |
---|---|---|
0 | 1 | -1 |
1 | -1 | 2 |
-2 | 2 | -4 |
3.6 | 1.44 | 2.16 |
999 | 111 | 888 |
ADomain, nr of rows = 5