POW macro
The POW
macro
is available in HCL®
Campaign and HCL
Interact.
Syntax
base POW exponent base ^ exponent
Parameters
base
The
numerical values to raise to an exponential power. This can be a constant
value, a column, a cell range, or an expression evaluating to any
of the above. For the format definition of base
(same
as data
), see the "Macro Function Parameters"
section in the chapter in this guide for your HCL
product.
exponent
The
exponential number(s) to raise the values in data
by. This can be a constant value, a column, a cell range, or an expression
evaluating to any of the above. The number of columns in exponent
must equal the number of columns in base
, unless base
is a constant. For the format definition of exponent
(same as data
), see the "Macro Function Parameters"
section in the chapter in this guide for your HCL
product.
Description
POW
raises
the values in the first data range to the power specified in the second
data range (that is, calculates ).
It returns one new column for each input column, each containing the
result of raising the base
to the exponent
power (that is, the first column of data1
is raised
to the first column of data
, the second column with
the second column, and so on).
If exponent
is a constant, each value in base
is raised by that
value. If exponent
contains one or more columns,
the calculations are performed on a row-by-row basis between one column
from base
and one column from exponent
.
The first row of base
is raised to the first row
value of exponent
, the second row with the second
row, and so on. This row-by-row calculation produces a result for
each row up to the last value of the shortest column.
POW
operator can be abbreviated with
a circumflex (^
). For example, TEMP
=
2^8
is equivalent to TEMP
=
2
POW 8
.base^exponent
exceeds the maximum or minimum 32-bit floating-point value.Examples
TEMP = 2 POW 3 or TEMP = 2^3 Creates
a new column named |
TEMP = V1 ^ 0.5 Creates a new column named |
TEMP = V1 ^ V3 Creates a new column named |
TEMP = V1:V3 ^ V4:V6 Creates three new columns
named |
TEMP = V1[10:20] POW V2 or TEMP =
V1[10:20] POW V2[1:11] Creates a new column named |
Related functions
Function | Description |
---|---|
EXP |
Computes the natural number (e) raised to the contents of each cell in the specified data range |
LN or LOG |
Computes the natural log of the contents of the specified data range |
LN2 |
Computes the log base2 of the contents of the specified data range |
LN10 |
Computes the log base10 of the contents of the specified data range |