BeSly Software Solutions About yab Demos About us Admin






Name:

floor()  compute the floor for its (float) argument

Synopsis:
 
print floor(x)

Description:
The floor-function returns the largest integer number, that is smaller or equal than its argument. For positive numbers x, floor(x) is the same as int(x); for negaive numbers it can be different (see the example below).

Example:
print int(-1.5),floor(-1.5)
print int(-1),floor(-1)
print int(1.5),floor(1.5)

Explanation:

This example compares the functions int and floor, starting with -1 -2, then -1 -1 and ending with 1 1, which shows the different behaviour of both functions.


Related: ceil, int, frac, round