From df2862cf54858ba5b1ada7d2ca99e57f3c13dd23 Mon Sep 17 00:00:00 2001 From: kakulisen Date: Wed, 29 Apr 2020 15:43:11 +0800 Subject: [PATCH] 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 --- src/math/example_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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 +} -- 2.48.1