Neg
Arithmetic functions negative (-)
syntax
- neg(a)
- - a
definition
neg(a) or - a results in the negative values of Data item a.
applies to
Data item or Unit with Numeric Value type
The negation of an unsigned value that is larger than the largest signed value of the same width, the value type of the result, is an error: neg(uint8(200)) fails, since the largest int8 value is 127. A Null remains null.
example
1. attribute<float32> negA (ADomain) := neg(A);
2. attribute<float32> negA (ADomain) := - A;
| A | negA |
|---|---|
| 0 | 0 |
| 1 | -1 |
| -2 | 2 |
| 3.6 | -3.6 |
| 999 | -999 |
ADomain, nr of rows = 5