About every 3 years I have needed a function that rounds a number
to the closest [some other number].  The most common use is where
the engineers might ask that all numbers be rounded to the nearest
0.03 inch, or material thickness be specified to the nearest 0.0625...

Having needed this function in almost every language I have used, I
hereby give it to you in C.  The file round2.c contains the function
round2(); if compiled with -DR2DEBUG, it prints out its input and
output.  The file testr2.c is a simple test program for round2().
The file round2.misc contains the same function written in fortran77
and APT (Automatic Programmed Tools).

I figure that this is not a hard function to write, but it sure has
been useful.  Hope you find a use for it, too.
--
Tom Mackey                                (206) 342-1442 (wk)
Boeing Computer Services    ....uw-beaver!ssc-vax!voodoo!tomm
M/S 03-73,     P.O. Box 24346,     Seattle, WA     98124-0346

