 |
|
Sommaire
Mathématiques
Introduction
Abs
Acos
acosh
Asin
asinh
Atan
Atan2
atanh
base_convert
BinDec
Ceil
Cos
cosh
DecBin
DecHex
DecOct
deg2rad
Exp
Floor
getrandmax
hexdec
lcg_value
Log
Log10
max
min
mt_rand
mt_srand
mt_getrandmax
number_format
OctDec
pi
pow
rad2deg
rand
round
Sin
sinh
Sqrt
srand
Tan
tanh
|
6.50.34 pow[ Exemples avec pow ] PHP 3, PHP 4 >= 4.0.0Description
number pow(number base ,number exp )
pow retourne base
élevé à la puissance exp.
Si possible, pow retourne un integer.
Si le calcul ne peut être fait, une alerte sera affichée et
pow retournera FALSE.
Quelques exemples avec pow |
<?php var_dump( pow(2,8) ); // int(256) echo pow(-1,20); // 1 echo pow(0, 0); // 1 echo pow(-1, 5.5); // erreur ?>
|
Attention |
En PHP 4.0.6 plus ancien, pow retournait
toujours un nombre à virgule flottante (float),
et n'affichait pas d'alerte. Si le calcul est impossible
(racine d'un nombre négatif, par exemple),
pow retournait NAN.
|
Voir aussi
exp.
|
|
 |
 |