Skip to main content
Scalar function
Returns NULL when an argument is NULL.

Syntax

Scalar

Arguments

Returns

  • Type: DOUBLE
  • Possible values: A whole-valued DOUBLE for finite input; signed zero, NaN and infinities are preserved.
  • NULL behavior: Returns NULL when an argument is NULL.

Properties

  • Approximation bound: No fixed maximum error is guaranteed.

Usage notes

  • Numeric input is converted to DOUBLE before rounding. DECIMAL values and large integers can lose precision during this conversion.
  • INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.
  • Exact result: Floating-point computation can round the mathematical result.

Examples

Halfway values and NULL input

Negative half-way values

Last modified on October 15, 2026