groostav
03/07/2017, 7:32 PMsize
is 32, and our modulo
is 5, then I want a function that gives back 30 (30 is the largest number less than 32 that is divided by 5 evenly)
eg2: if size
is 25, and our modulo
is 5, then I want 25
eg3: if size
is 3, and our modulo
is 5, then I want 0
I think floor(size / modulo) * modulo
is as good as it gets but I'm afraid some rounding errors might burn me here for particular numbers