JavaScript PI attribute

Definition and usage

PI The property is π, which is the ratio of the circumference of a circle to its diameter. This value is approximately 3.141592653589793.

Example

Returns PI:

Math.PI;

Try it yourself

Syntax

Math.PI

Technical details

Return value: Number, representing PI.
JavaScript version: ECMAScript 1

Webbläsarstöd

Math.PI Är ES1-funktioner (JavaScript 1999). Alla webbläsare stöder det fullt ut:

Chrome IE Edge Firefox Safari Opera
Stöd Stöd Stöd Stöd Stöd Stöd

Relaterade sidor

Lär:JavaScript matematik