Set of built-in mathematical functions to perform common arithmetic, logarithmic, and trigonometric operations. These functions support floating-point calculations and are useful for data analysis, financial computations, and scientific applications.
For more details, see SQLite Built-In Mathematical SQL Functions.
Basic Arithmetic & Rounding Functions Copy Link
Set of basic arithmetic and rounding functions for performing numerical operations. These functions are useful for calculations, rounding values, and handling precision.
abs(X) Copy Link
Returns the absolute value of X.
Example:
abs(-15);
Output: 15
round(X, Y) Copy Link
Rounds X to Y decimal places (default is 0).
Example:
round(5.6789, 2);
Output: 5.68
ceil(X) / ceiling(X) Copy Link
Returns the smallest integer greater than or equal to X.
Example:
ceil(4.3), ceiling(-4.3);
Output: 5, -4
floor(X) Copy Link
Returns the largest integer less than or equal to X.
Example:
floor(4.9), floor(-4.9);
Output: 4, -5
trunc(X) Copy Link
Returns the integer part of X, rounding toward zero.
Example:
trunc(5.9), trunc(-5.9);
Output: 5, -5
Power & Root Functions Copy Link
For handling exponents and roots in mathematical calculations.
pow(X, Y) / power(X, Y) Copy Link
Calculates X to the power of Y.
Example:
pow(2, 3);
Output: 8
sqrt(X) Copy Link
Returns the square root of X (NULL if X is negative).
Example:
sqrt(16);
Output: 4
Logarithmic & Exponential Functions Copy Link
Functions to perform logarithmic and exponential operations, which are commonly used in mathematical, scientific, and financial calculations.
exp(X) Copy Link
Calculates e^X, where e is approximately 2.718.
Example:
exp(2);
Output: 7.38905609893
ln(X) Copy Link
Returns the natural logarithm (ln, base e) of X.
Example:
ln(10);
Output: 2.30258509299
log(X) / log10(X) Copy Link
Returns the base-10 logarithm of X.
Example:
log10(100);
Output: 2
log(B, X) Copy Link
Returns the logarithm of X to base B.
Example:
log(2, 8);
Output: 3
log2(X) Copy Link
Returns the base-2 logarithm of X.
Example:
log2(32);
Output: 5
Trigonometric Functions (Angles in Radians) Copy Link
Functions that work with angles in radians.
sin(X), cos(X), tan(X) Copy Link
Calculates the sine, cosine, or tangent of X (X is in radians).
Example:
sin(3.14159), cos(3.14159), tan(3.14159);
Output: 0.00000265359, -1, -0.00000265359
asin(X), acos(X), atan(X) Copy Link
Returns the inverse sine, cosine, or tangent of X, in radians.
Example:
asin(0.5), acos(0.5), atan(1);
Output: 0.523598, 1.047198, 0.785398
atan2(Y, X) Copy Link
Calculates the arctangent of Y/X in radians, considering the quadrant.
Example:
atan2(1, 1);
Output: 0.785398
(π/4)
degrees(X) Copy Link
Converts X from radians into degrees.
Example:
degrees(3.14159);
Output: 179.99984796
(~180°)
radians(X) Copy Link
Converts X from degrees into radians.
Example:
radians(180);
Output: 3.14159
(~π)
Hyperbolic Functions Copy Link
Functions which are analogs of the trigonometric functions but for hyperbolic geometry. These functions are commonly used in areas like complex analysis, calculus, and physics.
sinh(X), cosh(X), tanh(X) Copy Link
Calculates the hyperbolic sine, cosine, or tangent of X.
Example:
sinh(1), cosh(1), tanh(1);
Output: 1.1752, 1.54308, 0.76159
asinh(X), acosh(X), atanh(X) Copy Link
Calculates the inverse hyperbolic sine, cosine, or tangent of X.
Example:
asinh(1), acosh(2), atanh(0.5);
Output: 0.88137, 1.31696, 0.54931
Miscellaneous Functions Copy Link
Functions for a variety of tasks, such as mathematical transformations, string manipulations, and system-related operations. These functions don’t fall under specific categories like trigonometric or arithmetic functions but are still commonly used for various purposes.
pi() Copy Link
Returns an approximation for π.
Example:
pi();
Output: 3.14159265359
mod(X, Y) Copy Link
Returns the remainder after dividing X by Y.
Example:
mod(10, 3);
Output: 1
Don’t stop here! Copy Link
Explore our User Guide.
For a complete tutorial on how to create a Flow, see “How to create a Flow in Wiresk”