Ceiling

Description

Determines the smallest whole number that is greater than or equal to a specified limit.

Syntax

Ceiling ( n )

Argument

Description

n

The number for which you want the smallest whole number that is greater than or equal to it

Returns

The datatype of n. Returns the smallest whole number that is greater than or equal to n. If n is null, Ceiling returns null.

Examples

Example 1

These statements set num to 5:

decimal dec, num

dec = 4.8

num = Ceiling(dec)

Example 2

These statements set num to –4:

decimal num

num = Ceiling(-4.2)

num = Ceiling(-4.8)

See also