JavaScript PIProperty

Math 对象参考手册JavaScript Math Object

Example

Return PI:

Math.PI;

Output:

3.141592653589793

Try it Yourself »

Definition and Usage

The PI property is π, which is the ratio of a circle's circumference to its diameter. This 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 对象参考手册JavaScript Math Object

Other Extensions