Skip to main content

pi

1. PI Function

The PI function in H2 database is used to retrieve the numerical value of the mathematical constant π (pi).

2. Syntax

The syntax for the PI function in H2 database is as follows:

PI()

Arguments

  • The PI function does not require any arguments.

Return

  • The PI function returns the numerical value of π (pi).

3. Notes

  • The PI function in H2 database does not accept any arguments and always returns the same value, which is approximately 3.141592653589793.
  • The returned value is of type DOUBLE.

4. Examples

Here are a few examples demonstrating the usage of the PI function in H2 database:

Example 1 - Retrieving the value of π:

SELECT PI() AS pi_value;

Output:

pi_value
-------------------
3.141592653589793

Example 2 - Using π in a mathematical calculation:

SELECT PI() * 2 AS circumference
FROM DUAL;

Output:

circumference
-------------------
6.283185307179586

There are no direct related functions to the PI function in H2 database. However, you can use the PI value in conjunction with various mathematical functions and calculations.