elvish/util/ceildiv.go
2016-02-28 01:56:17 +01:00

7 lines
139 B
Go

package util
// CeilDiv computes ceil(float(a)/b) without using float arithmetics.
func CeilDiv(a, b int) int {
return (a + b - 1) / b
}