floor

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the floor of <number>
floor(<number>)
Summary

Returns the greatest integer less than or equal to number.

Introduced7.1
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
number

Any number, or expression that evaluates to a number.

Example
floor(33.567) -- result is 33
floor(-6.3) -- result is -7
Values
NameTypeDescription
return

The floor function returns an integer.

RelatedKeyword: integer
Function: ceiling, round, abs, trunc
Glossary: return
Control Structure: function
Description

Use the floor function to return the greatest integer less than or equal to a number.

The floor function is different from round in that floor completely ignores the fractional part of the number. For example, floor(5.1) returns 5, but floor(4.99) returns 4. This means that the floor function does not always return the integer closest to the number.

Tagsmath