DB2 Version 9.7 for Linux, UNIX, and Windows

FLOOR scalar function

Read syntax diagramSkip visual syntax diagram
>>-FLOOR--(--expression--)-------------------------------------><

The schema is SYSIBM. (The SYSFUN version of the FLOOR function continues to be available.)

Returns the largest integer value less than or equal to the argument.

The result of the function has the same data type and length attribute as the argument except that the scale is 0 if the argument is DECIMAL. For example, an argument with a data type of DECIMAL(5,5) returns DECIMAL(5,0).

The result can be null if the argument can be null or if the argument is not a decimal floating-point number and the database is configured with dft_sqlmathwarn set to YES; the result is the null value if the argument is null.

Notes

Results involving DECFLOAT special values: For decimal floating-point values, the special values are treated as follows:
  • FLOOR(NaN) returns NaN.
  • FLOOR(-NaN) returns -NaN.
  • FLOOR(Infinity) returns Infinity.
  • FLOOR(-Infinity) returns -Infinity.
  • FLOOR(sNaN) returns NaN and a warning.
  • FLOOR(-sNaN) returns -NaN and a warning.

Examples