array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), '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 => 'Mathematische Funktionen', ), '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

Beschreibung

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.

Parameter-Liste

num
The base to use.
exponent
The exponent.

Rückgabewerte

Returns a float corresponding to $num$exponent.

Beispiele

Beispiel #1 fpow() example

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

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

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

Siehe auch