xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Ceiling()

Rounds a decimal number to the next higher integer.

Syntax

Ceiling( <nValue> ) --> nInteger

Arguments

<nValue>
Any numeric value can be passed.

Return

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

Info

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

Example

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

   PROCEDURE Main

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

      ? Ceiling( -2.00001 )   // result: -2

      ? Ceiling(  2.0 )       // result: 2

      ? Ceiling(  2.00001 )   // result: 3

   RETURN

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