All functions > MATH
All functions in the MATH category.
Backend availability
DD Available DD Partially available DD Not available DD DuckDB · PG Postgres · CH ClickHouse · TR Trino · BQ BigQuery · SF Snowflake · DB Databricks · SV Serving
Arithmetic
| Function | Description | Backends |
|---|
+ [addition] | Adds two numeric values, or adds an interval to a date or timestamp. | DD | PG | CH | TR | BQ | SF | DB | SV |
UNARY_MINUS() | Negates a numeric expression (unary minus). | DD | PG | CH | TR | BQ | SF | DB | SV |
UNARY_PLUS() | Explicit unary plus on an expression (no-op on the value). | DD | PG | CH | TR | BQ | SF | DB | SV |
- [subtraction] | Subtracts the right-hand value from the left-hand value (numeric, temporal, or interval forms). | DD | PG | CH | TR | BQ | SF | DB | SV |
FACTORIAL() | Returns the factorial of a non-negative integer (n!). | DD | PG | CH | TR | BQ | SF | DB | SV |
CLAMP() | Constrains a value to a closed interval: the result is the value limited to lie between low and... | DD | PG | CH | TR | BQ | SF | DB | SV |
* [multiplication] | Returns the product of two numbers, or scales an interval by an integer factor. | DD | PG | CH | TR | BQ | SF | DB | SV |
/ [division] | Divides the left-hand number by the right-hand number, producing a DOUBLE result. | DD | PG | CH | TR | BQ | SF | DB | SV |
// [type-preserving] | Divides the left-hand number by the right-hand number while preserving the dividend's type... | DD | PG | CH | TR | BQ | SF | DB | SV |
% [remainder] | Returns the remainder after dividing the left-hand number by the right-hand number. | DD | PG | CH | TR | BQ | SF | DB | SV |
Rounding
| Function | Description | Backends |
|---|
ROUND() | Rounds a number to the nearest integer or to a specified number of decimal places. | DD | PG | CH | TR | BQ | SF | DB | SV |
TRUNCATE() | Returns the integer part of a number by discarding the fractional part. | DD | PG | CH | TR | BQ | SF | DB | SV |
FLOOR() | Returns the largest integer less than or equal to the input. | DD | PG | CH | TR | BQ | SF | DB | SV |
CEIL() | Returns the smallest integer greater than or equal to the input. | DD | PG | CH | TR | BQ | SF | DB | SV |
Sign And Absolute
| Function | Description | Backends |
|---|
ABS() | Returns the absolute value of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
SIGN() | Returns the sign of a number: -1 for negative, 0 for zero, 1 for positive. | DD | PG | CH | TR | BQ | SF | DB | SV |
Exponential
| Function | Description | Backends |
|---|
^ [exponentiation] | Raises a number to a power (integer or floating-point operands of the same type). | DD | PG | CH | TR | BQ | SF | DB | SV |
SQRT() | Returns the square root of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
CBRT() | Returns the cube root of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
EXP() | Returns e raised to the power of the given number. | DD | PG | CH | TR | BQ | SF | DB | SV |
LN() | Returns the natural logarithm (base e) of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
LOG() | Returns the logarithm of a number to a specified base. | DD | PG | CH | TR | BQ | SF | DB | SV |
Trigonometric
| Function | Description | Backends |
|---|
COS() | Returns the cosine of an angle in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
SIN() | Returns the sine of an angle in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
TAN() | Returns the tangent of an angle in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
ACOS() | Returns the arccosine (inverse cosine) of a number, in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
ASIN() | Returns the arcsine (inverse sine) of a number, in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
ATAN() | Returns the arctangent (inverse tangent) of a number, in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
ATAN2() | Returns the arctangent of y/x, using the signs of both arguments to determine the quadrant. | DD | PG | CH | TR | BQ | SF | DB | SV |
Hyperbolic
| Function | Description | Backends |
|---|
COSH() | Returns the hyperbolic cosine of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
SINH() | Returns the hyperbolic sine of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
TANH() | Returns the hyperbolic tangent of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
Angle Conversion
| Function | Description | Backends |
|---|
DEGREES() | Converts an angle from radians to degrees. | DD | PG | CH | TR | BQ | SF | DB | SV |
RADIANS() | Converts an angle from degrees to radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
Base Conversion
| Function | Description | Backends |
|---|
FROM_BASE() | Returns the decimal (base 10) equivalent of a number expressed in a specified base. | DD | PG | CH | TR | BQ | SF | DB | SV |
TO_BASE() | Returns the string representation of a decimal number in a specified base. | DD | PG | CH | TR | BQ | SF | DB | SV |
Constant
| Function | Description | Backends |
|---|
E() | Returns the mathematical constant e (Euler's number). | DD | PG | CH | TR | BQ | SF | DB | SV |
PI() | Returns the mathematical constant π (pi). | DD | PG | CH | TR | BQ | SF | DB | SV |
Bucketing
| Function | Description | Backends |
|---|
WIDTH_BUCKET_REGULAR() | Returns the bucket number for a value in equally-spaced buckets within a range. | DD | PG | CH | TR | BQ | SF | DB | SV |
WIDTH_BUCKET() | Returns the bucket number for a value in a histogram with custom bin boundaries. | DD | PG | CH | TR | BQ | SF | DB | SV |
Summary
Functions in this category: 40