From: kakulisen Date: Wed, 29 Apr 2020 07:43:11 +0000 (+0800) Subject: math: Add a function example X-Git-Tag: go1.15beta1~292 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=df2862cf54858ba5b1ada7d2ca99e57f3c13dd23;p=gostls13.git math: Add a function example When I browsed the source code, I saw that there is no corresponding example of this function. I am not sure if there is a need for an increase, this is my first time to submit CL. Change-Id: Idbf4e1e1ed2995176a76959d561e152263a2fd26 Reviewed-on: https://go-review.googlesource.com/c/go/+/230741 Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- diff --git a/src/math/example_test.go b/src/math/example_test.go index 50c7426979..ce9c383256 100644 --- a/src/math/example_test.go +++ b/src/math/example_test.go @@ -219,3 +219,11 @@ func ExampleTrunc() { // 3.00 // -1.00 } + +func ExampleCbrt() { + fmt.Printf("%.2f\n", math.Cbrt(8)) + fmt.Printf("%.2f\n", math.Cbrt(27)) + // Output: + // 2.00 + // 3.00 +}