Commit efddc161 authored by Andrii Soldatenko's avatar Andrii Soldatenko Committed by Brad Fitzpatrick

math: add examples to Ceil, Floor, Pow, Pow10 functions

Change-Id: I9154df128b349c102854bb0f21e4c313685dd0e6
Reviewed-on: https://go-review.googlesource.com/118659Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent a7d89572
......@@ -89,3 +89,27 @@ func ExampleSqrt() {
fmt.Printf("%.1f", c)
// Output: 5.0
}
func ExampleCeil() {
c := math.Ceil(1.49)
fmt.Printf("%.1f", c)
// Output: 2.0
}
func ExampleFloor() {
c := math.Floor(1.51)
fmt.Printf("%.1f", c)
// Output: 1.0
}
func ExamplePow() {
c := math.Pow(2, 3)
fmt.Printf("%.1f", c)
// Output: 8.0
}
func ExamplePow10() {
c := math.Pow10(2)
fmt.Printf("%.1f", c)
// Output: 100.0
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment