Cloud

pi

The pi() function returns the mathematical constant pi (π).

Syntax

PI()

The pi() function takes no arguments.

Return type

double precision

Examples

Basic usage

SELECT PI();
        pi
-------------------
 3.141592653589793
(1 row)

Use pi() in an expression

This example uses pi() to convert an angle in radians to degrees:

SELECT DEGREES(PI());
 degrees
---------
     180
(1 row)