duckdb-spreadsheets / numeric_functions.tsv
lhoestq's picture
lhoestq HF staff
add all functions
4c86203
Name Description
@(x) Absolute value. Parentheses are optional if x is a column name.
abs(x) Absolute value.
acos(x) Computes the arccosine of x.
add(x, y) Alias for x + y.
asin(x) Computes the arcsine of x.
atan(x) Computes the arctangent of x.
atan2(y, x) Computes the arctangent (y, x).
bit_count(x) Returns the number of bits that are set.
cbrt(x) Returns the cube root of the number.
ceil(x) Rounds the number up.
ceiling(x) Rounds the number up. Alias of ceil.
cos(x) Computes the cosine of x.
cot(x) Computes the cotangent of x.
degrees(x) Converts radians to degrees.
divide(x, y) Alias for x // y.
even(x) Round to next even number by rounding away from zero.
exp(x) Computes e ** x.
factorial(x) See ! operator. Computes the product of the current integer and all integers below it.
fdiv(x, y) Performs integer division (x // y) but returns a DOUBLE value.
floor(x) Rounds the number down.
fmod(x, y) Calculates the modulo value. Always returns a DOUBLE value.
gamma(x) Interpolation of the factorial of x - 1. Fractional inputs are allowed.
gcd(x, y) Computes the greatest common divisor of x and y.
greatest_common_divisor(x, y) Computes the greatest common divisor of x and y.
greatest(x1, x2, ...) Selects the largest value.
isfinite(x) Returns true if the floating point value is finite, false otherwise.
isinf(x) Returns true if the floating point value is infinite, false otherwise.
isnan(x) Returns true if the floating point value is not a number, false otherwise.
lcm(x, y) Computes the least common multiple of x and y.
least_common_multiple(x, y) Computes the least common multiple of x and y.
least(x1, x2, ...) Selects the smallest value.
lgamma(x) Computes the log of the gamma function.
ln(x) Computes the natural logarithm of x.
log(x) Computes the base-10 logarithm of x.
log10(x) Alias of log. Computes the base-10 logarithm of x.
log2(x) Computes the base-2 log of x.
multiply(x, y) Alias for x * y.
nextafter(x, y) Return the next floating point value after x in the direction of y.
pi() Returns the value of pi.
pow(x, y) Computes x to the power of y.
power(x, y) Alias of pow. computes x to the power of y.
radians(x) Converts degrees to radians.
random() Returns a random number x in the range 0.0 <= x < 1.0.
round_even(v NUMERIC, s INTEGER) Alias of roundbankers(v, s). Round to s decimal places using the rounding half to even rule. Values s < 0 are allowed.
round(v NUMERIC, s INTEGER) Round to s decimal places. Values s < 0 are allowed.
setseed(x) Sets the seed to be used for the random function.
sign(x) Returns the sign of x as -1, 0 or 1.
signbit(x) Returns whether the signbit is set or not.
sin(x) Computes the sin of x.
sqrt(x) Returns the square root of the number.
subtract(x, y) Alias for x - y.
tan(x) Computes the tangent of x.
trunc(x) Truncates the number.
xor(x, y) Bitwise XOR.