What is the cheapest way to roundup() or ceil() to multiple of 1000?
For example if cheapest way to roundup is implemented in the ceil function:
function ceil(uint a, uint m) returns (uint) {
//some cheap roundup to muliple function
}
then it is expected that:
- ceil(123456,1000) == 124000
- ceil(1,1000) == 1000
- ceil(0,1000) == 0
- ceil(123000,1000) == 123000