DIVIDE

All functions > MATH > DIVIDE

Divides the first number by the second and returns the result as a double.

Syntax

DIVIDE(dividend: T, divisor: T) → DOUBLE
sql

Type Parameters:

  • T: Numeric type: BIGINT, FLOAT, DOUBLE, or DECIMAL (both args same type)

Arguments

ParameterTypeRequiredDescription
dividendTYesNumber to be divided
divisorTYesNumber to divide by

Returns

DOUBLE - Always returns a double-precision floating point result

Notes

  • Both arguments are cast to DOUBLE before division
  • Returns NULL if either operand is NULL
  • Division by zero results in infinity or error (engine-dependent)
  • For integer division that preserves type, use DIVIDE_TYPE
  • Operator form: dividend / divisor
  • Result is always a floating-point number, even for integer inputs

See also

Examples

Last update at: 2025/10/13 10:23:46