array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.fpow.php', 1 => 'fpow', 2 => 'Raise one number to the power of another, according to IEEE 754', ), 'up' => array ( 0 => 'ref.math.php', 1 => 'Math 函数', ), 'prev' => array ( 0 => 'function.fmod.php', 1 => 'fmod', ), 'next' => array ( 0 => 'function.hexdec.php', 1 => 'hexdec', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/math/functions/fpow.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

fpow

(PHP 8 >= 8.4.0)

fpowRaise one number to the power of another, according to IEEE 754

说明

fpow(float $num, float $exponent): float

Returns the floating point result of raising num to the power of exponent. If num is zero and exponent is less than zero, then INF is returned.

参数

num
The base to use.
exponent
The exponent.

返回值

Returns a float corresponding to $num$exponent.

示例

示例 #1 fpow() example

<?php
var_dump
(fpow(10, 2));
var_dump(fpow(0, -3));
var_dump(fpow(-1, 5.5));
?>

以上示例会输出:

float(100)
float(INF)
float(NAN)

参见