floor[]

Round down value.

Rounds downward, returning the largest integral value that is not greater than x.

The floor[] function is a function that returns the largest integer less than or equal to a given number. It rounds the number down to the nearest integer. The input can be a number of any type that can be converted to a float, and the output will be an integer.

For example, floor[3.14159] would return 3, and floor[-2.5] would return -3.

It is commonly used in mathematical calculations and in situations where you want to round a number down to the nearest integer, such as when working with money or array indexing.

Syntax

floor[x]

Parameters

x Number to round down.
Return Value The value of x rounded downward.

Examples

#<result> = floor[2.3]
(print,#<result>)

result: 2

See also

round, ceil