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
Since GeoDMS 20.23.1 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. Before, it wrapped around: neg(uint8(200)) resulted in 56. 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