FLOOR()

All functions > MATH > FLOOR()

Returns the largest integer less than or equal to the input.

Signatures

Floor

Returns: Largest integer ≤ input

FLOOR(number: T) → BIGINT
sql
ParameterTypeRequiredDescription
numberTYesThe number to round down

With:

  • T : Custom types: FLOAT | DOUBLE | DECIMAL

Signature notes:

  • Always rounds toward negative infinity
  • Returns NULL if the input is NULL
  • Opposite of CEIL for negative numbers

Examples

FeatureQL
SELECT
    f1 := FLOOR(2.1E0), -- Positive rounds down
    f2 := FLOOR(2.9E0), -- Another positive
    f3 := FLOOR(-2.1E0), -- Negative rounds away from zero
    f4 := FLOOR(-2.9E0), -- Negative further from zero
    f5 := FLOOR(5.0E0), -- Exact integer unchanged
    f6 := FLOOR(3.14159E0) -- Pi rounds down to 3
;
Result
f1 BIGINTf2 BIGINTf3 BIGINTf4 BIGINTf5 BIGINTf6 BIGINT
22-3-353

Last update at: 2026/05/26 17:22:09