elvish/edit/ceildiv.go
2016-02-12 13:31:24 +01:00

7 lines
139 B
Go

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