Click or drag to resize

Floor Function

X#
Round a number down to the next lowest integer.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION Floor(
	nNum AS USUAL
) AS USUAL
Request Example View Source

Parameters

nNum
Type: Usual
The number to round.

Return Value

Type: Usual
The nearest integer that is less than or equal to nNum.
Remarks
Floor() rounds a negative value with a fractional portion down to the preceding integer and returns the integer portion of a positive number.
Examples
This example uses Floor() on a positive and a negative number:
X#
1? Floor(1.6)            // 1
2? Floor(-1.6)            // -2 (since -2 < -1)
See Also