/* * c e i l . c */ #ifdef DOCUMENTATION title ceil smallest integer not less than argument index smallest integer not less than argument usage .s double x, y, ceil(); .br y = ceil(x); .s description .s Returns the smallest integer not less than the argument. .s diagnostics .s If the argument is greater than the integer part of HUGE a floating point overflow exception will occur. .s internal .s author .s Hamish Ross. .s date .s 31-Jan-85 #endif double ceil(x) double x; { double y, modf(); return((modf(x, &y) > 0.0) ? y + 1.0 : y); }