Skip to main content

Mathematical Constants

HelixQL provides built-in mathematical constants PI and E for use in calculations. These constants are provided as functions that return their respective values with high precision.

Available Constants

PI - Pi Constant

Returns the mathematical constant π (pi), the ratio of a circle’s circumference to its diameter.

E - Euler’s Number

Returns the mathematical constant e (Euler’s number), the base of natural logarithms.
When using the SDKs or curling the endpoint, the query name must match what is defined in the queries.hx file exactly.

Example 1: Circle calculations with PI

Calculate circle properties using the PI constant:
Here’s how to run the query using the SDKs or curl

Example 2: Exponential growth with E

Model exponential growth and decay using Euler’s number:
Here’s how to run the query using the SDKs or curl

Common Use Cases

Degree-Radian Conversion

Use PI for converting between degrees and radians:

Circular Motion

Calculate properties of circular motion:

Compound Interest

Use E for continuous compound interest calculations:

Natural Decay

Model radioactive decay or other natural decay processes:
Constants are particularly useful when combined with trigonometric functions (SIN, COS, TAN) and exponential functions (EXP, LN).

Precision

Both PI() and E() return high-precision values suitable for scientific and engineering calculations:
  • PI() returns π to approximately 20 decimal places
  • E() returns e to approximately 20 decimal places
The constants are implemented as functions rather than literals to maintain consistency with HelixQL’s function-based syntax.

Use in Complex Formulas

Constants are often used in complex mathematical formulas:

Trigonometric Functions

SIN, COS, TAN, ASIN, ACOS, ATAN, ATAN2

Unary Math Functions

SQRT, ABS, LN, LOG10, EXP, CEIL, FLOOR, ROUND

Arithmetic Functions

ADD, SUB, MUL, DIV, POW, MOD

Math Overview

Overview of all math functions