Pi Function in PHP

Pi Function in PHP. In this program we can print the value of pi using the function pie. Because Pi is an irrational number, it cannot be stated in the form of p/q. However, we proclaim Pi as 22/7 because to find the area or circumference of a circle, we only need the first three digits, which are 3.14, and the value of 22/7 is 3.14285, thus we declare pi as 22/7.

<?php
echo(pi());
?>

 

Output:

3.1415926535898

Pi Definition in Php

Pi () is a number that is about 3.142. It is the circumference divided by the diameter of any circle. One of the most frequent constants in mathematics is the number Pi, symbolised by the Greek letter – pronounced ‘pie’. It is the circumference divided by the diameter of any circle. It wasn’t until the 18th century, over two millennia after Archimedes determined the importance of the number 3.14, that the moniker “pi” was first used to describe the number. “He used it because the Greek letter Pi corresponds to the letter ‘P,’ and pi is about the circumference of a circle.”