pow - Power Function

Prev Next

Function Names

pow

Description

Calculates the x (base value) ^ y (power exponent).

Call as: function

Restrictions

Indirect parameter passing is disabled

Parameter count

2

Parameters

No.TypeDescription
1
input
numeral Base value

Value to be raised to the power exponent

2
input
numeral Exponent

Exponent value to apply.

Default value: 1

Return value

TypeDescription
numeral Result

Calculated result

Exceptions

Values provided is not a numerals
rounding intervals is negative or zero

Examples

      echo( pow( 7, 2 ) );
      echo( pow( 3, 3 ) );
      echo( pow( 81, 0.5 ) );
      echo( pow( 27, 1/3 ) );

Output

49
27
9
3
Try it yourself: Open LIB_Function_pow.b4p in B4P_Examples.zip. Decompress before use.

See also

Square Root