home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / cctools / libstuff / round.c < prev   
C/C++ Source or Header  |  1995-01-20  |  175b  |  16 lines

  1. #include "stuff/round.h"
  2. /*
  3.  * round() rounds v to a multiple of r.
  4.  */
  5. __private_extern__
  6. long
  7. round(
  8. long v,
  9. unsigned long r)
  10. {
  11.     r--;
  12.     v += r;
  13.     v &= ~(long)r;
  14.     return(v);
  15. }
  16.