totn MariaDB Functions

MariaDB: PI Function

This MariaDB tutorial explains how to use the MariaDB PI function with syntax and examples.

Description

The MariaDB PI function returns the value of π (pi) displayed with 6 decimal places.

Syntax

The syntax for the PI function in MariaDB is:

PI( )

Parameters or Arguments

There are no parameters or arguments for the PI function.

Note

  • The PI function displays the value of pi with only 6 decimal places. However, internally it uses the double-precision value when used in calculations with other double-precision values.
  • See also the DEGREES and RADIANS functions.

Applies To

The PI function can be used in the following versions of MariaDB:

  • MariaDB 10

Example

Let's look at some MariaDB PI function examples and explore how to use the PI function in MariaDB.

For example:

SELECT PI();
Result: 3.141593

SELECT PI()*1;
Result: 3.141593

SELECT PI()*1.000000000000000;
Result: 3.141592653589793