Mathematical Functions
NOTE
Verification Status: Tested and verified against the rekuiper runtime with streaming telemetry data on 2026-10-01 16:28:52 UTC.
Scorecard: 33 / 33 Mathematical Functions Fully Verified with Live Data (100% Parity):abs, acos, asin, atan, atan2, bitand, bitor, bitxor, bitnot, ceil, ceiling, conv, cos, cosh, cot, degrees, exp, floor, ln, log, mod, pi, pow, power, radians, rand, round, sign, sin, sinh, sqrt, tan, tanh.
All functions tested with live telemetry data and validated with exact mathematical assertions.
Mathematical functions perform numerical operations. They accept numeric inputs and return numeric values.
ABS
abs(col)Returns the absolute value of the argument.
ACOS
acos(col)Returns the arc cosine of the argument in radians.
ASIN
asin(col)Returns the arc sine of the argument in radians.
ATAN
atan(col)Returns the arc tangent of the argument in radians.
ATAN2
atan2(col1, col2)Returns the angle in radians between the positive x-axis and the coordinate point (col1, col2).
BITAND
bitand(col1, col2)Performs a bitwise AND operation on the integer representations of the two arguments.
BITOR
bitor(col1, col2)Performs a bitwise OR operation on the integer representations of the two arguments.
BITXOR
bitxor(col1, col2)Performs a bitwise exclusive OR (XOR) operation on the integer representations of the two arguments.
BITNOT
bitnot(col1)Performs a bitwise NOT operation on the integer representation of the argument.
CEIL
CEIL() is a synonym for CEILING().
CEILING
ceiling(col)Returns the smallest integer value greater than or equal to the argument.
COS
cos(col)Returns the cosine of an angle expressed in radians.
COSH
cosh(col)Returns the hyperbolic cosine of the argument.
EXP
exp(col)Returns Euler's constant $e$ raised to the power of the argument.
FLOOR
floor(col)Returns the largest integer value less than or equal to the argument.
LN
ln(col)Returns the natural logarithm (base $e$) of the argument.
LOG
log(col)
log(b, col)- When called with one argument, returns the base-10 logarithm of
col. Returnsnilifcol <= 0. - When called with two arguments, returns the base-
blogarithm ofcol. Returnsnilifcol <= 0orb <= 1.
MOD
mod(col1, col2)Returns the remainder of dividing col1 by col2.
PI
pi()Returns the constant value of $\pi$ (3.141592653589793).
POW
POW() is a synonym for POWER().
POWER
power(col1, col2)Returns col1 raised to the power of col2.
RAND
rand()Returns a pseudo-random floating-point number between 0.0 (inclusive) and 1.0 (exclusive).
ROUND
round(v, [s])Rounds v to s decimal places. If s is omitted, rounds to the nearest integer:
round(42.4) --> 42
round(42.4382, 2) --> 42.44SIGN
sign(col)Returns the sign of the argument: 1 for positive numbers, -1 for negative numbers, and 0 for zero.
SIN
sin(col)Returns the sine of an angle expressed in radians.
SINH
sinh(col)Returns the hyperbolic sine of the argument.
SQRT
sqrt(col)Returns the positive square root of the argument.
TAN
tan(col)Returns the tangent of an angle expressed in radians.
TANH
tanh(col)Returns the hyperbolic tangent of the argument.
COT
cot(col)Returns the cotangent of the argument.
RADIANS
radians(col)Converts angle measurements from degrees to radians.
DEGREES
degrees(col)Converts angle measurements from radians to degrees.
CONV
conv(N, from_base, to_base)Converts number N from radix from_base to radix to_base. Returns a string representation of the converted number. Returns NULL if any argument is NULL. Supported bases range from 2 to 36:
SELECT conv('a', 16, 2);
-- Output: '1010'
SELECT conv('6E', 18, 8);
-- Output: '172'
SELECT conv(-17, 10, -18);
-- Output: '-H'