Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section

PI

A scalar numeric function that returns the constant value of pi.

Synopsis

{fn PI()}
{fn PI}

Description

PI takes no arguments. It returns the mathematical constant pi as data type DECIMAL with a precision of 19 and a scale of 18.

PI can only be invoked using ODBC scalar function (curly brace) syntax. Note that the argument parentheses are optional.

Examples

The following examples both return the value of pi:

SELECT {fn PI()} AS ExactPi
Copy code to clipboard
SELECT {fn PI} AS ExactPi
Copy code to clipboard

returns 3.141592653589793238.

See Also

  • SQL functions: ROUND

  • ObjectScript special variable: $ZPI

Feedback