w3resource

PostgreSQL PI() function

PI() function

The PostgreSQL PI() function is used to return the constant value of pi, which is approximately 3.14159.

Uses of PI() Function
  • Mathematical Calculations: To perform calculations involving the constant pi.

  • Geometry and Trigonometry: Essential in computations related to circles, spheres, and trigonometric functions.

  • Scientific Research: Used in various scientific formulas and research that require the value of pi.

  • Engineering Applications: Important for engineering calculations involving circular or periodic phenomena.

  • Data Analysis: Utilized in statistical models and data analysis requiring precise value of pi.

Syntax:

pi()

PostgreSQL Version: 9.3

Pictorial presentation of PostgreSQL PI() function

pictorial presentation of PostgreSQL PI() function

Example: PostgreSQL PI() function :

Code:

SELECT PI() AS "Value of PI";

Sample Output:

    Value of PI
------------------
 3.14159265358979
(1 row)

Previous: MOD function
Next: POWER function



Follow us on Facebook and Twitter for latest update.