Math Functions
# StreamSQL Math Functions
Math functions are used for numerical calculations.
# Basic Math Functions
# ABS - Absolute Value Function
Syntax: abs(number)
Description: Returns the absolute value of a number.
# SQRT - Square Root Function
Syntax: sqrt(number)
Description: Returns the square root of a number.
# POWER - Power Function
Syntax: power(base, exponent)
Description: Returns the base raised to the specified power.
# CEILING - Ceiling Function
Syntax: ceiling(number)
Description: Returns the smallest integer greater than or equal to the specified number.
# FLOOR - Floor Function
Syntax: floor(number)
Description: Returns the largest integer less than or equal to the specified number.
# ROUND - Round Function
Syntax: round(number, [precision])
Description: Rounds a number to the specified number of decimal places.
# MOD - Modulo Function
Syntax: mod(dividend, divisor)
Description: Returns the remainder of a division operation.
# RAND - Random Function
Syntax: rand()
Description: Returns a random number between 0 and 1.
# SIGN - Sign Function
Syntax: sign(number)
Description: Returns the sign of a number (-1, 0, or 1).
# Trigonometric Functions
# SIN - Sine Function
Syntax: sin(number)
Description: Returns the sine of an angle (in radians).
# COS - Cosine Function
Syntax: cos(number)
Description: Returns the cosine of an angle (in radians).
# TAN - Tangent Function
Syntax: tan(number)
Description: Returns the tangent of an angle (in radians).
# ASIN - Arc Sine Function
Syntax: asin(number)
Description: Returns the arc sine of a number (in radians).
# ACOS - Arc Cosine Function
Syntax: acos(number)
Description: Returns the arc cosine of a number (in radians).
# ATAN - Arc Tangent Function
Syntax: atan(number)
Description: Returns the arc tangent of a number (in radians).
# ATAN2 - Two-Parameter Arc Tangent Function
Syntax: atan2(y, x)
Description: Returns the arc tangent of y/x (in radians).
# Hyperbolic Functions
# SINH - Hyperbolic Sine Function
Syntax: sinh(number)
Description: Returns the hyperbolic sine of a number.
# COSH - Hyperbolic Cosine Function
Syntax: cosh(number)
Description: Returns the hyperbolic cosine of a number.
# TANH - Hyperbolic Tangent Function
Syntax: tanh(number)
Description: Returns the hyperbolic tangent of a number.
# Logarithmic and Exponential Functions
# EXP - Exponential Function
Syntax: exp(number)
Description: Returns e raised to the specified power.
# LN - Natural Logarithm Function
Syntax: ln(number)
Description: Returns the natural logarithm of a number.
# LOG - Logarithm Function
Syntax: log(base, number)
Description: Returns the logarithm with the specified base.
# LOG10 - Common Logarithm Function
Syntax: log10(number)
Description: Returns the common logarithm (base 10) of a number.
# LOG2 - Binary Logarithm Function
Syntax: log2(number)
Description: Returns the binary logarithm (base 2) of a number.
# Bitwise Functions
# BIT_AND - Bitwise AND Function
Syntax: bit_and(number1, number2)
Description: Performs bitwise AND operation on two integers.
# BIT_OR - Bitwise OR Function
Syntax: bit_or(number1, number2)
Description: Performs bitwise OR operation on two integers.
# BIT_XOR - Bitwise XOR Function
Syntax: bit_xor(number1, number2)
Description: Performs bitwise XOR operation on two integers.
# BIT_NOT - Bitwise NOT Function
Syntax: bit_not(number)
Description: Performs bitwise NOT operation on an integer.
# 📚 Related Documentation
- Aggregate Functions - Learn detailed usage of aggregate functions
- String Functions - Learn detailed usage of string functions
- SQL Reference - View complete SQL syntax reference