dos_floor - dalefugier/DOSLib GitHub Wiki

Calculates the floor of a number. The function returns a value representing the largest integer that is less than or equal to the number.

Syntax

(dos_floor number)

Parameters

number

The number.

Returns

The value representing the largest integer that is less than or equal to the number, if successful.

nil on error.

Example

Command: (dos_floor -1.6)
-2
Command: (dos_floor -1.5)
-2
Command: (dos_floor -1.4)
-2
Command: (dos_floor 1.4)
1
Command: (dos_floor 1.5)
1
Command: (dos_floor 1.6)
1