# Pi: Most widely known mathematical constant

Pi is the most widely known mathematical constant that is commonly defined as the ratio of a circle’s circumference to its diameter approximately equal to 3.14159. It is also represented by the Greek letter “π”.
I am writing here about the Pi because It always attract me and in my programming life there are many situation when I need to use the pi value in programming such as to calculate the area of the circle. Pi is an irrational number, meaning its digits go on forever in a seemingly random sequence. Commonly we use the 22/7 to calculate the value of Pi that gives the never ended decimal represented without any repeating pattern.

### Approximate value

Fractions: Approximate fractions include (in order of increasing accuracy) 22/7, 333/106, 355/113, 52163/16604, 103993/33102, and 245850922/78256779

Decimal: The first 100 decimal digits are 3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510 58209 74944 59230 78164 06286 20899 86280 34825 34211 70679 ….

Binary: 11.001001000011111101101010100010001000010110100011 ….

Hexadecimal: The base 16 approximation to 20 digits is 3.243F6A8885A308D31319 …

### Use Pi in C#

In C#, Math.Pi field Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π. And the value of this field is 3.14159265358979323846.

The following example uses PI to calculate the area of the circle.

```class UseOfPi
{
static void Main(string[] args)
{
UseOfPi objClass = new UseOfPi();
}
{
return area;
}
}```

### Use Pi in JavaScript

We can use math.pi to get the constant value of PI. Value of the PI is approximately 3.14159. You can use math.pi in JavaScript like this:

```<html>
<title> Value of PI </title>