PHP pi() FunctionThe pi() is the important mathematical function of PHP, which is used to solve math problems. It returns the approximation value of PI. We can use the M_PI constant as results to pi(). Syntax:Example 1Output: By using 'pi()' Function the value of PI : 3.1415926535898 Example 2Output: By using 'M_PI' constant the value of PI : 1.5707963267949 Example 3Output: By using 'M_PI_2' constant the value of PI : 1.5707963267949 By using 'M_PI_4' constant the value of PI : 0.78539816339745 Example 4Output: By using 'M_SQRTPI' constant the value of PI : 1.7724538509055 Example 5Output: By using 'M_2_SQRTPI' constant the value of PI : 1.1283791670955
Next TopicPHP Math
|