PI | Syntax: | PI() | Return value: | FLOAT, π | Function type: | Numeric function | |
|
|
The PI() function returns the value of π (PI). |
Example |
|
select pi() as result;
select round(pi(),16) as result;
|
|
result |
double(8) |
3.141593 |
|
|
result |
double(33) |
3.1415926535897930 |
|
|
|
The examples were created with the MyWAY SQL manager: |
How to use the PI() function in MySQL and MariaDB databases |
The PI() function in MySQL and MariaDB returns the π constant, which is the ratio of a circle's circumference to its diameter and is approximately 3.141592653589793. The function is a convenient way to access the π constant without having to remember or hardcode its value. It ensures accuracy and consistency in calculations involving circles, trigonometry, or other scenarios where π is required. |
|
Further MySQL und MariaDB SQL Numeric functions |
|