Math Functions
Math functions help you to implement different mathematical concepts in queries.
Function | Return Type | Input Arguments | Description |
---|---|---|---|
abs({x}) | Same as the input |
| Returns the absolute value of x . |
acos({angle}) | Double |
| Returns the arc cosine of the input. |
asin({angle}) | Double |
| Returns the arc sine of the input. |
atan({angle}) | Double |
| Returns the arc tangent of the input. |
beta_cdf({x}, {y}, {v}) | Double |
| Computes the Beta cdf with given x and y parameters: P(N < z; x, y) . |
cbrt({x}) | Same as input |
| Returns the cube root of the input. |
ceil({x}) | Same as input |
| Returns the input argument rounded up to the nearest integer. |
cos({angle}) | Double |
| Returns the cosine of the input. |
cosh({angle}) | Double |
| Returns the hyperbolic cosine of the input. |
cosine_similarity({x}, {y}) | Double |
| Returns the cosine similarity between the input sparse vectors. |
degrees({angle}) | Double |
| Converts input angle in radians to degrees. |
e() | Double | None | Returns the constant Euler’s number. |
exp({x}) | Double |
| Returns Euler’s number raised to the power of x. |
floor({x}) | Integer |
| Returns the input value rounded down to the nearest integer. |
from_base({string}, {radix}) | Bigint |
| Returns the value of the string interpreted as a base-radix number. |
infinity() | Double | None | Returns the constant representing positive infinity. |
inverse_beta_cdf({mean}, {standard_deviation}, {probability}) | Double |
| Compute the inverse of the Beta cdf with given mean and standard_deviation for the cumulative probability (p): P(N < n). The mean is a real value and the standard deviation is a real and positive value. The probability p lies on the interval (0, 1). |
inverse_normal_cdf({mean}, {standard_deviation}, {probability}) | Double |
| Compute the inverse of the Normal cdf with given mean and standard_deviation for the cumulative probability (p): P(N < n). The mean is a real value and the standard deviation is a real and positive value. The probability p lies on the interval (0, 1). |
is_finite({x}) | Boolean |
| Returns true if the input value is finite, otherwise false. |
is_nan({x}) | Boolean |
| Returns true if the input value is not-a-number, otherwise false. |
ln({x}) | Double |
| Returns the natural logarithm of the input value. |
log({base}, {x}) | Double |
| Returns the input base logarithm of the input value. |
log2({x}) | Double |
| Returns the base 2 logarithm of the input value. |
log10({x}) | Double |
| Returns the base 10 logarithm of the input value. |
mod({x}, {y}) | Same as input |
| Returns the modulus (remainder) of x divided by y. |
nan() | Double | None | Returns the constant representing not-a-number. |
normal_cdf({mean}, {standard_deviation}, {v}) | Double |
| Compute the Normal cdf with given mean and standard_deviation: P(N < v; mean, sd). The mean and value v are real values, and the standard_deviation is a real and positive value. |
pi() | Double | None | Returns the constant pi . |
pow({x}, {y}) | Double |
| Returns x raised to the power of y . |
power({x}, {y}) | Double |
| Returns x raised to the power of y. |
radians({angle}) | Double |
| Converts the input angle in degrees to radians. |
rand() | Double | None | Returns a pseudo-random value in the range 0.0 <= x < 1.0. |
random() | Double | None | Returns a pseudo-random value in the range 0.0 <= x < 1.0. |
round({x}) | Double |
| Returns input value rounded to the nearest integer. |
sign({x}) | Integer |
| Returns the signum function of the input. |
sin({angle}) | Double |
| Returns the sine of the input. |
sqrt({x}) | Same as input |
| Returns the square root of the input argument. |
tan({angle}) | Double |
| Returns the tangent of the input. |
tanh({angle}) | Double |
| Returns the hyperbolic tangent of the input. |
to_base({x}, {radix}) | Varchar |
| Returns the base-radix representation of the input. |
truncate({x}) | Double |
| Returns input rounded to integer by dropping digits after the decimal point. |
wilson_interval_lower({successes}, {trials}, {Z}) | Double |
| Returns the lower bound of the Wilson score interval of a Bernoulli trial process at a confidence specified by the z-score Z. |
wilson_interval_upper({successes}, {trials}, {Z}) | Double |
| Returns the upper bound of the Wilson score interval of a Bernoulli trial process at a confidence specified by the z-score Z. |