Operator | Description |
---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division (integer division performs truncation) |
% | Modulus (remainder) |
abs(x)
→ same as inputx
.
cbrt(x)
→ doublex
.
ceil(x)
→ same as inputceiling
.
ceiling(x)
→ same as inputx
rounded up to the nearest integer.
degrees(x)
→ doublex
in radians to degrees.
e()
→ doubleexp(x)
→ doublex
.
floor(x)
→ same as inputx
rounded down to the nearest integer.
ln(x)
→ doublex
.
log(b, x)
→ doubleb
logarithm of x
.
log2(x)
→ doublex
.
log10(x)
→ doublex
.
mod(n, m)
→ same as inputn
divided by m
.
pi()
→ doublepow(x, p)
→ doublepower
.
power(x, p)
→ doublex
raised to the power of p
.
radians(x)
→ doublex
in degrees to radians.
round(x)
→ same as inputx
rounded to the nearest integer.
round(x, d)
→ same as inputx
rounded to d
decimal places.
sign(x)
→ same as inputx
, that is:
sqrt(x)
→ doublex
.
truncate(x)
→ doublex
rounded to integer by dropping digits after decimal point.
width_bucket(x, bound1, bound2, n)
→ bigintx
in an equi-width histogram with the specified bound1
and bound2
bounds and n
number of buckets.
width_bucket(x, bins)
→ bigintx
according to the bins specified by the array bins
. The bins
parameter must be an array of doubles and is assumed to be in sorted ascending order.
rand()
→ doublerandom()
.
random()
→ doublerandom(n)
→ same as inputrandom(m, n)
→ same as inputdegrees
and radians
.
acos(x)
→ doublex
.
asin(x)
→ doublex
.
atan(x)
→ doublex
.
atan2(y, x)
→ doubley / x
.
cos(x)
→ doublex
.
cosh(x)
→ doublex
.
sin(x)
→ doublex
.
tan(x)
→ doublex
.
sinh(x)
→ double
Returns the hyperbolic sine of x
.
tanh(x)
→ doublex
.
infinity()
→ doubleis_finite(x)
→ booleanx
is finite.
is_infinite(x)
→ booleanx
is infinite.
is_nan(x)
→ booleanx
is not-a-number.
nan()
→ doublefrom_base(string, radix)
→ bigintstring
interpreted as a base-radix
number.
to_base(x, radix)
→ varcharradix
representation of x
.
cosine_similarity(x, y)
→ doublex
and y
:
SELECT cosine_similarity(MAP(ARRAY[‘a’], ARRAY[1.0]), MAP(ARRAY[‘a’], ARRAY[2.0])); — 1.0
wilson_interval_lower(successes, trials, z)
→ doublez
.
wilson_interval_upper(successes, trials, z)
→ doublez
.
beta_cdf(a, b, v)
→ doubleinverse_beta_cdf(a, b, p)
→ doubleinverse_normal_cdf(mean, sd, p)
→ doublenormal_cdf(mean, sd, v)
→ double