Ceiling()

CEILING()

Rounds up a number to the next integer

Syntax

      CEILING( <nNumber> ) -> nUpRoundedNumber

Arguments

<nNumber> number to round up

Returns

<nUpRoundedNumber> the rounded number

Description

The function CEILING() determines the smallest integer that is bigger than <nNumber>.

Examples

      ? ceiling( 1.1 )  // --> 2.0
      ? ceiling( -1.1 ) // --> -1.0

Tests

      ceiling( 1.1 )  == 2.0
      ceiling( -1.1 ) == -1.0

Compliance

CEILING() is compatible with CT3’s CEILING().

Platforms

All

Files

Source is math.c, library is libct.

Seealso

FLOOR

Harbour All Functions – F

Fact

Fahrenheit

FClose()
FCount()
FCreate()
FErase()
FError()
FieldBlock()

FieldDeci()

FieldGet()

FieldName()
FieldPos()
FieldPut()

FieldSize()
FieldType()

FieldWBlock()

File()
FLock()

Floor

FOpen()

Found()

FRead()
FReadStr()
FRename()
FSeek()

FToC

FV

FWrite()

Harbour Math Functions

Abs

ACos

ASin

ATan

ATn2

Cos

CosH

DToR

Exp

Exponent 

Fact

Floor

GetPrec

hb_mathErBlock
hb_mathErMode
hb_mathGetErrMode
hb_mathGetHandler
hb_mathGetLastError
hb_mathIsMathErr
hb_mathResetError
hb_mathSetErrMode
hb_mathSetHandler

Infinity
Int
Log

Log10
Max

Mantissa
Min
Mod

Pi
Round

RToD

SetPrec

Sign

Sin

SinH
Sqrt

Tan

TanH

CT_FLOOR

 FLOOR()
 Rounds down to the next integer
------------------------------------------------------------------------------
 Syntax

     FLOOR(<nValue>) --> nSmallerInteger

 Argument

     <nValue>  Designates the number for which the next-smaller integer
     is determined.

 Returns

     FLOOR() returns the next-smaller integer of the one passed as a
     parameter.

 Description

     FLOOR() always returns the next-smaller integer of the one passed as a
     parameter.  This applies to positive and negative numbers.

 Example

     Show the next-smaller integer for positive and negative numbers:

     ? FLOOR(1.9)       // Result:  1
     ? FLOOR(1.1)       // Result:  1
     ? FLOOR(0.9)       // Result:  0
     ? FLOOR(-0.1)      // Result: -1
     ? FLOOR(-0.9)      // Result: -1
     ? FLOOR(-1.1)      // Result: -2

See Also: CEILING()

 

Tools — Mathematical Functions

Introduction Mathematical Functions
ACOS()    Computes the cosine arc
ASIN()    Computes the sine arc
ATAN()    Computes the tangent arc
ATN2()    Computes the angle size from the sine and cosine
CEILING() Rounds up to the next integer
COS()     Computes the cosine
COT()     Computes the cotangent
DTOR()    Converts from a degree to radian measure
FACT()    Computes the factorial
FLOOR()   Rounds down to the next integer
FV()      Computes future value of capital
GETPREC() Determines the level of precision that is set
LOG10()   Computes the common logarithm
PAYMENT() Computes the periodic payment amount
PERIODS() Computes number of payment periods necessary to repay a loan
PI()      Returns pi with the highest degree of accuracy
PV()      Computes the cash present value after interest charges
RATE()    Computes the interest rate for a loan
RTOD()    Converts from a radian to degree measure
SETPREC() Sets the precision level for trigonometric functions
SIGN()    Determines the mathematical sign of a number
SIN()     Computes the sine of a radian value
TAN()     Computes the tangent of a radian value