ABAP Keyword Documentation → ABAP - Reference → Processing Internal Data → Numeric Calculations → Numerical Functions
ipow - Integer Power Function
Other versions:
7.31 | 7.40 | 7.54
Syntax
... ipow( base = arg exp = n ) ...
Effect
This function raises the argument arg passed to base
to the exponent n passed to exp. The arguments arg and n are
numerical expression positions. Any
numeric data object
can be specified for arg. n expects the type i and exponents of other types are
converted to i.
If the argument arg has the value 0, then the value of the exponent n must be greater than or equal to 0.
The function ipow is overloaded with the effect that the return value can have different numerical types.
- With the exception of an
arithmetic expression, the data type of the argument
argdetermines the data type of the return value.
- Within an arithmetic expression, the argument
argcontributes to the calculation type of the entire expression and the function is calculated using the calculation type.
- If the argument
argis a numeric expression,ipowfunctions like an arithmetic operator and the function is handled in its operand position like an arithmetic expression.
This function can be specified in general and
numeric expression positions. The calculation type is determined from the argument arg in the same way as with the other
numerical functions. The argument n does not have any effect on the data type of the return value.
Notes
- The power function
ipowcan replacearg ** ncalculations, if the calculation type f is to be avoided. This makes sense if the typefis not precise enough.
- In many cases, the power function
ipowdisplays better performance than using the arithmetic operator**.
Example
See Power Function ipow.