xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Floor()

Rounds a decimal number to the next lower integer.

Syntax

Floor( <nValue> ) --> nInteger

Arguments

<nValue>
Any numeric value can be passed.

Return

The return value is the next lower integer value of <nValue>. If <nValue> is an integer already, it is returned unchanged.

Info

See also:Ceiling(), Round()
Category: CT:Math , Mathematical functions
Source:ct\ctmath2.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example shows results of function Floor().

   PROCEDURE Main

      ? Floor( -2.0 )       // result: -2

      ? Floor( -2.00001 )   // result: -3

      ? Floor(  2.0 )       // result: 2

      ? Floor(  2.00001 )   // result: 2

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe