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

Defined functions

ceil defined in line 25; used 1 times
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 659
Valid CSS Valid XHTML 1.0 Strict