Pow
Arithmetic functions power (^)
syntax
- pow(base, exp)
- base^exp
definition
pow(base, exp) or base^exp results in the element-by-element exponentiation of the base values of Data item base to the corresponding exponent values of data item exp.
description
The power operator can not (yet) be used associatively, expressions such as a^b^c are not allowed, use (a^b)^c instead.
applies to
Data items with float32 or float64 Value type
polygons
On two polygon attributes, ^ gives their symmetric difference element by element: bp_xor for spoint and ipoint coordinates, geos_xor for fpoint and dpoint coordinates. See polygon operators.
conditions
- Domain of the arguments must match or be Void (literals or parameters can be calculated with data items of any domain).
- Arguments must have matching:
example
1. attribute<float32> powAB (ADomain) := pow(A, B);
2. attribute<float32> powAB (ADomain) := A^B;
| A | B | powAB |
|---|---|---|
| 0 | 1 | 0 |
| 1 | 1 | 1 |
| 4 | 2 | 16 |
| 7 | 3 | 343 |
| -5 | -2 | 0.04 |
ADomain, nr of rows = 5
since version
^ on fpoint and dpoint polygons since 20.29.0