Ekinoderm
 

Archive for January, 2009

A Simple Algorithm for Rounding to the Nearest Multiple-of-n

Normally, I wouldn’t make such a brief post, but I’ve encountered (several times) some very bizarre and complicated algorithms to round to the nearest multiple-of-n (where n is 5 or 7 or whatever).  Say, for example, that you’re pricing your product for an overseas military base, and, as we know, overseas military bases don’t use [...]