For the complete documentation index, see llms.txt. This page is also available as Markdown.

floor

Returns the largest integer less than or equal to the input. If the input is already an integer, it is returned as-is.

Syntax

floor(value)

or chained:

<number>.floor()

Arguments

  • value (int | float, optional when chained) - The number to floor.

Examples

Round down a positive float

floor(3.7)
// 3

Negative values round toward negative infinity

floor(-2.3)
// -3

Integer input unchanged

floor(5)
// 5

CLI usage

Last updated