FLOOR()

 

Syntax:

       Then: xx=FLOOR(num_expr)

 

"num_expr" is the given number.

"xx" is the resulting value.

Return value is a field of the same edit type and length as num_expr.

 

NOTE: If the given number is already an integer, the original number is returned.

 

Version Ref:  4.5

 

Description:

Performs the FLOOR function, which given any number, returns the next lesser integer.

 

Examples:

Show the difference between FLOOR(), CEIL(), INT(), and converting to an integer:

Try the example with the numbers: -5.6 -5.5 -5.4 5.4 5.5 5.6 and note the differences among the functions.

       Then: input popup xx(10,.5) "Enter a number: "

        If: xx = ""

       Then: end

       Then: yy(10,.0) = xx

       Then: msgbox xx & "\nFLOOR:" < FLOOR(xx) & "\nCEIL:" < CEIL(xx)&       "\nINT:" < INT(xx) & "\nrounding:" < yy