1: /*
   2:  * floor - calculate largest integer not greater than d.
   3:  */
   4: double   modf();
   5: double
   6: floor(d)
   7: double d;
   8:    {
   9:    double fract;
  10: 
  11:    if (d<0.0) {
  12:       d = -d;
  13:       fract = modf(d, &d);
  14:       if (fract != 0.0)
  15:          d += 1;
  16:       d = -d;
  17:    } else
  18:       modf(d, &d);
  19:    return(d);
  20:    }
  21: 
  22: /*
  23:  * ceil - calculate smallest integer not less than d.
  24:  */
  25: double
  26: ceil(d)
  27: double d;
  28:    {
  29:    return(-floor(-d));
  30:    }

Defined functions

ceil defined in line 25; never used
floor defined in line 5; used 2 times
Last modified: 1984-11-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 753
Valid CSS Valid XHTML 1.0 Strict