Javatpoint Logo
Javatpoint Logo

PHP pi() Function

The 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 1

Output:

By using 'pi()' Function the value of PI : 3.1415926535898

Example 2

Output:

By using 'M_PI' constant the value of PI : 1.5707963267949

Example 3

Output:

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 4

Output:

By using 'M_SQRTPI' constant the value of PI : 1.7724538509055

Example 5

Output:

By using 'M_2_SQRTPI' constant the value of PI : 1.1283791670955

Next TopicPHP Math





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA