How do I make a ceil proc where I can specify the ceiling?
For example:
ceil(4, 8) = 8
ceil(9, 8) = 16
[edit]
Blargh.
I also need a floor proc that I can specify the floor of =/
For example:
floor(6, 4) = 4
floor(11, 4) = 8
floor(13, 4) = 12
Get it? =/
ID:165253
Jan 30 2007, 10:31 am (Edited on Jan 30 2007, 10:49 am)
|
|
Jan 30 2007, 11:12 am
|
|
You basically have to find the distance to the nearest multiple you want. You can use the module operator for that.
|