Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C - <b>ceil() calculate ceiling of value</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ceil()                   Calculate Ceiling of Value

 #include <math.h>

 double     ceil(x);                     Ceiling of value
 double     x;                           Floating point value

    ceil() returns a double value of the smallest integer that is greater
    than or equal to 'x'.

    Returns:    Smallest integer >= 'x'. There is no error return.

  -------------------------------- Example ---------------------------------

    The following statements calculate the ceiling of 3.3, 0.0 and -3.3.

         #include <math.h>      /* Required for function definition only */

         main()
         {
             double x, y, z;

             x = ceil(3.3);     /* x = 4.0 */
             y = ceil(0.0);     /* y = 0.0 */
             z = ceil(-3.3);    /* z = -3.0 */
         }

See Also: floor() fmod()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson