I am trying to round up a number x to be divisible by a number m. Using the following function from previous post on SO:
roundUP = function(x,m)
{
return(m * ceiling(x/m))
}
But, when I input x = 0.28 and m = 0.005, the function outputs 0.285 when the result should be 0.28.
When I tried ceiling(0.28/0.005)
it outputs 57 when the result should be 56 since 56 is already a whole number. Can anyone explain if is this happening and is this an error from Ceiling function?