ceil [C++ Reference]
Keywords: c,math,ceil
Date: 2009-03-19T23:51:12-0700

[[ceil]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## ceil

Syntax:

        #include <cmath>
        double ceil( double num );

The ceil() function returns the smallest integer no less than num. For example,

         y = 6.04;
         x = ceil( y );

would set x to 7.0.

C++ also provides the following overloaded forms:

        #include <cmath>
        float ceil( float num ); // same as ceilf() in C99
        long double ceil( long double num ); // same as ceill() in C99

Related Topics: floor, fmod

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •