ReferenceSPQL

Math

Apply numeric rounding, logarithmic, root, and trigonometric functions.

Scalar Functions

FunctionSummary
spql.math.absReturn the absolute value.
spql.math.acosCompute the inverse cosine in radians.
spql.math.asinCompute the inverse sine in radians.
spql.math.atanCompute the inverse tangent in radians.
spql.math.cbrtCompute the cube root.
spql.math.ceilRound upward to an integer-valued float.
spql.math.cosCompute the cosine of radians.
spql.math.coshCompute the hyperbolic cosine.
spql.math.degreesConvert radians to degrees.
spql.math.expRaise Euler's number to the input power.
spql.math.floorRound downward to an integer-valued float.
spql.math.interpolateLinearly interpolate between two floating-point values.
spql.math.lnCompute the natural logarithm.
spql.math.log10Compute the base-10 logarithm.
spql.math.log2Compute the base-2 logarithm.
spql.math.radiansConvert degrees to radians.
spql.math.roundRound to the nearest integer-valued float.
spql.math.signReturn the sign of a value.
spql.math.sinCompute the sine of radians.
spql.math.sinhCompute the hyperbolic sine.
spql.math.sqrtCompute the square root.
spql.math.tanCompute the tangent of radians.
spql.math.tanhCompute the hyperbolic tangent.
spql.math.truncTruncate 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

NameRequiredTypeDescription
valueyesf32, f64, decimalNumeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
loweryesf64Value at the lower coordinate.
upperyesf64Value at the upper coordinate.
weightyesf64Fractional 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric 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

NameRequiredTypeDescription
valueyesf32, f64Numeric input.

Returns

A floating-point value of the same width.

Found a problem? Edit this page or report an issue.

On this page