DIVIDE

All functions > MATH > DIVIDE

Returns the result of the division of the first number by the second as a double.

Signatures

Numeric division

Returns: Result of the division as a double

DIVIDE(dividend: T, divisor: T) → DOUBLE
sql
ParameterTypeRequiredDescription
dividendTYesNumber to be divided
divisorTYesNumber to divide by

Notes

  • Both arguments are cast to DOUBLE before division
  • Returns NULL if either operand is NULL
  • Division by zero raises an error on all backends
  • For integer division that preserves type, use DIVIDE_TYPE
  • For safe division that returns NULL on divide-by-zero, use TRY_DIVIDE
  • Operator form: dividend / divisor
  • Result is always a floating-point number, even for integer inputs

See also

Examples

FeatureQL
SELECT
    f1 := DIVIDE(10e0, 3e0),  -- Division with remainder
    f2 := DIVIDE(15e0, 5e0),  -- Exact division
    f3 := DIVIDE(7e0, 2e0),  -- Half result
    f4 := DIVIDE(-8e0, 4e0),  -- Negative division
    f5 := DIVIDE(22e0, 7e0)  -- Pi approximation
;
Result
f1 VARCHARf2 VARCHARf3 VARCHARf4 VARCHARf5 VARCHAR
3.33333333333333353.03.5-2.03.142857142857143

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19