FLOOR

All functions > MATH > FLOOR

Rounds a number down to the nearest integer (floor function).

Signatures

Returns: Integer result of rounding down

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

Notes

  • Always rounds towards negative infinity
  • FLOOR(2.1) = 2, FLOOR(2.9) = 2
  • FLOOR(-2.1) = -3, FLOOR(-2.9) = -3
  • Returns NULL if the input is NULL
  • For exact integers, returns the same value
  • Opposite behavior of CEIL function

Examples

FeatureQL
SELECT
    f1 := FLOOR(2.1e0),  -- Positive decimal rounds down
    f2 := FLOOR(2.9e0),  -- Another positive decimal
    f3 := FLOOR(-2.1e0),  -- Negative rounds away from zero
    f4 := FLOOR(-2.9e0),  -- Negative closer to integer
    f5 := FLOOR(5.0e0),  -- Exact integer unchanged
    f6 := FLOOR(0.0e0),  -- Zero unchanged
    f7 := FLOOR(3.14159e0),  -- Pi rounds down to 3
    f8 := FLOOR(-3.14159e0),  -- Negative pi rounds to -4
    f9 := FLOOR(2.4e0),  -- From tests
    f10 := FLOOR(-2.4e0)  -- Negative from tests
;
Result
f1 BIGINTf2 BIGINTf3 BIGINTf4 BIGINTf5 BIGINTf6 BIGINTf7 BIGINTf8 BIGINTf9 BIGINTf10 BIGINT
22-3-3503-42-3

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