POW macro
The POW macro is available in IBM® Campaign and IBM® 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 IBM® 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 IBM® 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.
*
The POW operator can be abbreviated with a circumflex (^). For example, TEMP = 2^8 is equivalent to TEMP = 2 POW 8.
*
If the value x is too large or too small, an overflow is returned. This occurs if 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 containing the value eight.
Creates a new column named TEMP, where each value is the square root of the contents of column V1 (this is equivalent to SQRT(V1)).
Creates a new column named TEMP, where each value is the row value of column V1 raised to the corresponding row value of column V2.
Creates three new columns named TEMP, VX, and VY. The column TEMP contains the values in V1 raised to the corresponding row values of column V4. The column VX contains the result of column V2 raised to the corresponding values in column V5. The column VY contains the the result of column V3 raised to the corresponding values of V6.
TEMP = V1[10:20] POW V2 or TEMP = V1[10:20] POW V2[1:11]
Creates a new column named TEMP, where the first 11 cells contain the result of raising the values in rows 10-20 of column V1 by the values in rows 1-10 of column V2. The other cells in TEMP are empty.
Related functions
LN or LOG