Maths: nearest multiple, using offsets
I'm a real dolt when it comes to solving maths problems. I've made a function that returns the nearest specified multiple of a specified value, including a specified offset. I think it's pretty good, but I was hoping that someone could see if I'm doing it as efficiently as possible.
By offsets, I mean offsetting a series of multiples. For example, if the multiple is 5 and the offset is 2, the series will go like this:
int nMult(int value, int mult, int offset)
int round(float value)
The reason I made the function is that list box heights in Win32 operate with multiple 16, offset 6. Any height specified for the height of a list box is rounded to the nearest multiple and offset. This caused me problems, so I made a function to round my window height appropriately.