SQLite Math Functions

The following table outlines the inbuilt mathematical functions available in SQLite.

FunctionDescription
acos(X)Returns the arccosine of X. The result is in radians.
acosh(X)Return the hyperbolic arccosine of X.
asin(X)Returns the arcsine of X. The result is in radians.
asinh(X)Returns the hyperbolic arcsine of X.
atan(X)Returns the arctangent of X. The result is in radians.
atan2(Y,X)Returns the arctangent of Y/X. The result is in radians.
atanh(X)Returns the hyperbolic arctangent of X.
ceil(X)
ceiling(X)
Returns the first representable integer value greater than or equal to X.
cos(X)Returns the cosine of X. X is in radians.
cosh(X)Returns the hyperbolic cosine of X.
degrees(X)Converts value X from radians into degrees.
exp(X)Computes e (Euler’s number) raised to the power X.
floor(X)Returns the first representable integer value less than or equal to X.
ln(X)Returns the natural logarithm of X.
log(X)
log10(X)
Returns the base-10 logarithm for X.
log(B,X)Returns the base-B logarithm of X.
log2(X)Returns the logarithm base-2 for the number X.
mod(X,Y)Returns the remainder after dividing X by Y.
pi()Returns π (pi). More specifically, returns an approximation of π.
pow(X,Y)
power(X,Y)
Computes X raised to the power Y.
radians(X)Converts X from degrees into radians.
sin(X)Returns the sine of X. X is in radians.
sinh(X)Returns the hyperbolic sine of X.
sqrt(X)Returns the square root of X.
tan(X)Returns the tangent of X. X is in radians.
tanh(X)Returns the hyperbolic tangent of X.
trunc(X)Returns the integer part of X, rounding toward zero. Basically, it cuts off the decimal part.