title: golang - ceil function like php?
body: <p>I want to return the least integer value greater than or equal to integer division. So I used <code>math.ceil</code>, but can not get the value I want.</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "math"
  )
  
  func main() {
      var pagesize int = 10
      var length  int = 43
  
      d := float64(length / pagesize)
      page := int(math.Ceil(d))
  
      fmt.Println(page)
      // output 4 not 5
  }
  </code></pre>
  
  <p><a href="http://golang.org/pkg/math/#Ceil" rel="noreferrer">http://golang.org/pkg/math/#Ceil</a></p>
  
  <p><a href="http://play.golang.org/p/asHta1HkO_" rel="noreferrer">http://play.golang.org/p/asHta1HkO_</a></p>
  
  <p>What is wrong?
  Thanks.</p>