Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript PI property

JavaScript PI property

Math Object Reference JavaScript Math object

Example

Returns PI:

Math.PI;

Output result:

3.141592653589793

Try it »


Definition and Usage

The PI property is pi, the ratio of a circle's circumference to its diameter. Its value is approximately 3.14.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the PI property.


Syntax

Math.PI

Technical Details

Return Value: Returns pi (approximately 3.14159).
JavaScript version: 1.0

Math Object Reference JavaScript Math object