8.65 Mathématiques
8 Référence des fonctions
Manuel PHP
. Introduction . Pré-requis . Installation . Configuration à l'exécution . Types de ressources . Constantes pré-définies . abs . acos . acosh . asin . asinh . atan . atan2 . atanh . base_convert . bindec . ceil . cos . cosh . decbin . dechex . decoct . deg2rad . exp . expm1 . floor . fmod . getrandmax . hexdec . hypot . is_finite . is_infinite . is_nan . lcg_value . log . log10 . log1p . max . min . mt_getrandmax . mt_rand . mt_srand . octdec ->pi . pow . rad2deg . rand . round . sin . sinh . sqrt . srand . tan . tanh
|
8.65.44 pi()Retourne la valeur de pi [ Exemples avec pi ] PHP 3, PHP 4, PHP 5
float
pi (
void
)
pi
retourne la valeur de pi.
La valeur retournée est de type
float
, et
est à la précision indiquée par la directive
precision , indiquée
dans le fichier
php.ini
, qui vaut par défaut
14
.
De plus, vous pouvez utiliser la constante
M_PI
,
qui retourne un résultat identique à la fonction
pi
.
| Exemple avec pi |
<?php echo pi(); // 3.1415926535898 echo M_PI; // 3.1415926535898 ?>
|
|