array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'function.pi.php', 1 => 'pi', ), 'up' => array ( 0 => 'ref.math.php', 1 => 'Fonctions Math', ), 'prev' => array ( 0 => 'function.octdec.php', 1 => 'octdec', ), 'next' => array ( 0 => 'function.pow.php', 1 => 'pow', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/math/functions/pi.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
pi — Retourne la valeur de pi
Retourne une approximation de pi.
De plus, vous pouvez utiliser la constante M_PI
,
qui retourne un résultat identique à la fonction
pi().
Cette fonction ne contient aucun paramètre.
La valeur de pi en tant que nombre décimal.
Exemple #1 Exemple avec pi()
<?php
echo pi(); // 3.1415926535898
echo M_PI; // 3.1415926535898
?>