You are here : phpmathpow

pow() - math

Returns base raised to the power of
   exp.
Parameters :
  • base - The base to use
  • exp - The exponent

  • Syntax

    number pow
         ( number $base
        , number $exp
        )


    Example

    <?phpvar_dump(pow(2, 8)); // int(256)echo pow(-1, 20); // 1echo pow(0, 0); // 1echo pow(10, -1); // 0.1echo pow(-1, 5.5); // PHP >=5.2.2: NANecho pow(-1, 5.5); // PHP <5.2.2: -NAN?>


    Output / Return Value


    Limitations


    Alternatives / See Also


    Reference