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); ?>
(PHP 8 >= 8.4.0)
fpow — Raise one number to the power of another, according to IEEE 754
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
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)