All functions > MATH

All functions in the MATH category.

Arithmetic

FunctionDuckDBTrinoServingDescription
+ [addition]✓✓✓Adds two numeric values, or adds an interval to a date or timestamp.
UNARY_MINUS()✓✓✓Negates a numeric expression (unary minus).
UNARY_PLUS()✓✓✓Explicit unary plus on an expression (no-op on the value).
- [subtraction]✓✓✓Subtracts the right-hand value from the left-hand value (numeric, temporal, or interval forms).
FACTORIAL()✓✓✓Returns the factorial of a non-negative integer (n!).
CLAMP()✓✓✓Constrains a value to a closed interval: the result is the value limited to lie between low and...
* [multiplication]✓✓✓Returns the product of two numbers, or scales an interval by an integer factor.
/ [division]✓✓✓Divides the left-hand number by the right-hand number, producing a DOUBLE result.
// [type-preserving]✓✓✓Divides the left-hand number by the right-hand number while preserving the dividend's type...
% [remainder]✓✓✓Returns the remainder after dividing the left-hand number by the right-hand number.

Rounding

FunctionDuckDBTrinoServingDescription
ROUND()✓✓✓Rounds a number to the nearest integer or to a specified number of decimal places.
TRUNCATE()✓✓✓Returns the integer part of a number by discarding the fractional part.
FLOOR()✓✓✓Returns the largest integer less than or equal to the input.
CEIL()✓✓✓Returns the smallest integer greater than or equal to the input.

Sign And Absolute

FunctionDuckDBTrinoServingDescription
ABS()✓✓✓Returns the absolute value of a number.
SIGN()✓✓✓Returns the sign of a number: -1 for negative, 0 for zero, 1 for positive.

Exponential

FunctionDuckDBTrinoServingDescription
^ [exponentiation]✓✓✓Raises a number to a power (integer or floating-point operands of the same type).
SQRT()✓✓✓Returns the square root of a number.
CBRT()✓✓✓Returns the cube root of a number.
EXP()✓✓✓Returns e raised to the power of the given number.
LN()✓✓✓Returns the natural logarithm (base e) of a number.
LOG()✓✓✓Returns the logarithm of a number to a specified base.

Trigonometric

FunctionDuckDBTrinoServingDescription
COS()✓✓✓Returns the cosine of an angle in radians.
SIN()✓✓✓Returns the sine of an angle in radians.
TAN()✓✓✓Returns the tangent of an angle in radians.
ACOS()✓✓✓Returns the arccosine (inverse cosine) of a number, in radians.
ASIN()✓✓✓Returns the arcsine (inverse sine) of a number, in radians.
ATAN()✓✓✓Returns the arctangent (inverse tangent) of a number, in radians.
ATAN2()✓✓✓Returns the arctangent of y/x, using the signs of both arguments to determine the quadrant.

Hyperbolic

FunctionDuckDBTrinoServingDescription
COSH()✓✓✓Returns the hyperbolic cosine of a number.
SINH()✓✓✓Returns the hyperbolic sine of a number.
TANH()✓✓✓Returns the hyperbolic tangent of a number.

Angle Conversion

FunctionDuckDBTrinoServingDescription
DEGREES()✓✓✓Converts an angle from radians to degrees.
RADIANS()✓✓✓Converts an angle from degrees to radians.

Base Conversion

FunctionDuckDBTrinoServingDescription
FROM_BASE()✗✓✗Returns the decimal (base 10) equivalent of a number expressed in a specified base.
TO_BASE()✓✓✓Returns the string representation of a decimal number in a specified base.

Constant

FunctionDuckDBTrinoServingDescription
E()✓✓✓Returns the mathematical constant e (Euler's number).
PI()✓✓✓Returns the mathematical constant π (pi).

Bucketing

FunctionDuckDBTrinoServingDescription
WIDTH_BUCKET_REGULAR()✗✓✗Returns the bucket number for a value in equally-spaced buckets within a range.
WIDTH_BUCKET()✗✓✗Returns the bucket number for a value in a histogram with custom bin boundaries.

Summary
Functions in this category: 40

This documentation is automatically generated from the FeatureMesh registry.