Ceiling Function

Ceiling Function
All Functions

Summary

Returns the least integer greater than or equal to the number n.

Syntax

How to use

The ceiling function returns the least integer greater than or equal to a number. For example, the ceiling of returns the integer . The function is useful for rounding numbers up to the nearest integer.

 ceil(6.28) = 7

Examples

 ceil(1.3) = 2
 ceil(2.0) = 2
 ceil(0.8) = 1
 ceil(7.813) = 8
 ceil(16.21) = 17
 ceil(5.0) = 5
 ceil(5.1) = 6

Related Functions

Returns the integer part of the number n.

Returns the nearest integer to the number n.