PI

The ratio of the circumference of a circle to its diameter, approximately 3.14159. PI is static, read-only.

Property of

Math

Examples

The following function returns the value of pi:

function getPi() {
      return Math.PI
}

Description

Because PI is a static property of Math, you always use it as Math.PI, rather than as a property of a Math object you created.