Returns the smallest multiple of a that is not smaller than b.
| 59 | |
| 60 | // Returns the smallest multiple of a that is not smaller than b. |
| 61 | int64 NextMultiple(int64 a, int64 b) { |
| 62 | const int64 remainder = b % a; |
| 63 | return remainder == 0 ? b : (b + a - remainder); |
| 64 | } |
| 65 | |
| 66 | // Returns a / b rounded up to the next higher integer. |
| 67 | int64 CeilOfRatio(int64 a, int64 b) { return (a + b - 1) / b; } |