commit | 4607ebc7d897c36687ae4ede3cfd4939c6dd0a54 | [log] [tgz] |
---|---|---|
author | Pedro Lopez Mareque <pedro.lopez.mareque@gmail.com> | Sat Oct 02 11:59:08 2021 +0200 |
committer | Robert Griesemer <gri@golang.org> | Thu Oct 07 18:09:53 2021 +0000 |
tree | cb7b667bb59efc1732be159a39ef22c9ae28c6d4 | |
parent | 019ad98b5337992625327ea07185ad06a9c19169 [diff] |
math: add Remainder example Change-Id: I4b0fa69a36b04103473aa08e246fa193315ac5aa Reviewed-on: https://go-review.googlesource.com/c/go/+/353689 Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Go Bot <gobot@golang.org>
diff --git a/src/math/example_test.go b/src/math/example_test.go index 9fc1967..a26d8cb 100644 --- a/src/math/example_test.go +++ b/src/math/example_test.go
@@ -162,6 +162,11 @@ // Output: 2.0 } +func ExampleRemainder() { + fmt.Printf("%.1f", math.Remainder(100, 30)) + // Output: 10.0 +} + func ExampleMod() { c := math.Mod(7, 4) fmt.Printf("%.1f", c)