Math
Apply numeric rounding, logarithmic, root, and trigonometric functions.
Scalar Functions
| Function | Summary |
|---|---|
spql.math.abs | Return the absolute value. |
spql.math.acos | Compute the inverse cosine in radians. |
spql.math.asin | Compute the inverse sine in radians. |
spql.math.atan | Compute the inverse tangent in radians. |
spql.math.cbrt | Compute the cube root. |
spql.math.ceil | Round upward to an integer-valued float. |
spql.math.cos | Compute the cosine of radians. |
spql.math.cosh | Compute the hyperbolic cosine. |
spql.math.degrees | Convert radians to degrees. |
spql.math.exp | Raise Euler's number to the input power. |
spql.math.floor | Round downward to an integer-valued float. |
spql.math.interpolate | Linearly interpolate between two floating-point values. |
spql.math.ln | Compute the natural logarithm. |
spql.math.log10 | Compute the base-10 logarithm. |
spql.math.log2 | Compute the base-2 logarithm. |
spql.math.radians | Convert degrees to radians. |
spql.math.round | Round to the nearest integer-valued float. |
spql.math.sign | Return the sign of a value. |
spql.math.sin | Compute the sine of radians. |
spql.math.sinh | Compute the hyperbolic sine. |
spql.math.sqrt | Compute the square root. |
spql.math.tan | Compute the tangent of radians. |
spql.math.tanh | Compute the hyperbolic tangent. |
spql.math.trunc | Truncate the fractional part. |
spql.math.abs
Return the absolute value.
- Kind:
scalar function - Volatility:
immutable
spql.math.abs(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64, decimal | Numeric input. |
Returns
A value of the same numeric type.
spql.math.acos
Compute the inverse cosine in radians.
- Kind:
scalar function - Volatility:
immutable
spql.math.acos(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.asin
Compute the inverse sine in radians.
- Kind:
scalar function - Volatility:
immutable
spql.math.asin(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.atan
Compute the inverse tangent in radians.
- Kind:
scalar function - Volatility:
immutable
spql.math.atan(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.cbrt
Compute the cube root.
- Kind:
scalar function - Volatility:
immutable
spql.math.cbrt(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.ceil
Round upward to an integer-valued float.
- Kind:
scalar function - Volatility:
immutable
spql.math.ceil(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.cos
Compute the cosine of radians.
- Kind:
scalar function - Volatility:
immutable
spql.math.cos(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.cosh
Compute the hyperbolic cosine.
- Kind:
scalar function - Volatility:
immutable
spql.math.cosh(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.degrees
Convert radians to degrees.
- Kind:
scalar function - Volatility:
immutable
spql.math.degrees(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.exp
Raise Euler's number to the input power.
- Kind:
scalar function - Volatility:
immutable
spql.math.exp(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.floor
Round downward to an integer-valued float.
- Kind:
scalar function - Volatility:
immutable
spql.math.floor(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.interpolate
Linearly interpolate between two floating-point values.
- Kind:
scalar function - Volatility:
immutable
spql.math.interpolate(lower, upper, weight) -> f64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
lower | yes | f64 | Value at the lower coordinate. |
upper | yes | f64 | Value at the upper coordinate. |
weight | yes | f64 | Fractional distance from the lower coordinate. |
Returns
lower + (upper - lower) * weight; null and NaN inputs propagate.
spql.math.ln
Compute the natural logarithm.
- Kind:
scalar function - Volatility:
immutable
spql.math.ln(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.log10
Compute the base-10 logarithm.
- Kind:
scalar function - Volatility:
immutable
spql.math.log10(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.log2
Compute the base-2 logarithm.
- Kind:
scalar function - Volatility:
immutable
spql.math.log2(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.radians
Convert degrees to radians.
- Kind:
scalar function - Volatility:
immutable
spql.math.radians(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.round
Round to the nearest integer-valued float.
- Kind:
scalar function - Volatility:
immutable
spql.math.round(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.sign
Return the sign of a value.
- Kind:
scalar function - Volatility:
immutable
spql.math.sign(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.sin
Compute the sine of radians.
- Kind:
scalar function - Volatility:
immutable
spql.math.sin(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.sinh
Compute the hyperbolic sine.
- Kind:
scalar function - Volatility:
immutable
spql.math.sinh(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.sqrt
Compute the square root.
- Kind:
scalar function - Volatility:
immutable
spql.math.sqrt(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.tan
Compute the tangent of radians.
- Kind:
scalar function - Volatility:
immutable
spql.math.tan(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.tanh
Compute the hyperbolic tangent.
- Kind:
scalar function - Volatility:
immutable
spql.math.tanh(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.
spql.math.trunc
Truncate the fractional part.
- Kind:
scalar function - Volatility:
immutable
spql.math.trunc(value) -> type(value)Same type and nullability as value.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | f32, f64 | Numeric input. |
Returns
A floating-point value of the same width.