ID EN
Mathematical Functions

PI()

MySQL 8.4

Returns the value of π (pi). The default number of decimal places displayed is seven, but MySQL uses the full double-precision value internally.

Syntax

MYSQL
SELECT PI();
3.141593
SELECT PI()+0.000000000000000000;
3.141592653589793000

Examples

Example

Because the return value of this function is a double-precision value, its exact representation may vary between platforms or implementations. This also applies to any expressions making use of PI(). See Section 13.1.4, “Floating-Point Types (Approximate Value) - FLOAT, DOUBLE”.

MYSQL
SELECT PI();
3.141593
SELECT PI()+0.000000000000000000;
3.141592653589793000