Ceiling

Ceiling[x]

gives the smallest integer greater than or equal to x.

Ceiling[x,a]

gives the smallest multiple of a greater than or equal to x.

Details

  • Mathematical function, suitable for both symbolic and numerical manipulation.
  • Ceiling[x] can be entered in StandardForm and InputForm as x, lc rc or
    [LeftCeiling]x[RightCeiling].
  • Ceiling[x] returns an integer when is any numeric quantity, whether or not it is an explicit number.
  • For exact numeric quantities, Ceiling internally uses numerical approximations to establish its result. This process can be affected by the setting of the global variable $MaxExtraPrecision.
  • Ceiling applies separately to real and imaginary parts of complex numbers.
  • Ceiling automatically threads over lists.

Examples

open allclose all

Basic Examples  (2)

Round up to the nearest integer:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Round up to the nearest multiple of 10:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Scope  (6)

Generalizations & Extensions  (5)

Applications  (4)

Properties & Relations  (9)

Possible Issues  (1)

Neat Examples  (1)

See Also

Floor  IntegerPart  FractionalPart  Round  Chop  BinCounts  Quantile  FindDivisions

Tutorials

Introduced in 1988
(1.0)
| Updated in 2007
(6.0)