diff options
| author | Pedro Lopez Mareque <pedro.lopez.mareque@gmail.com> | 2021-10-02 11:59:08 +0200 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2021-10-07 18:09:53 +0000 |
| commit | 4607ebc7d897c36687ae4ede3cfd4939c6dd0a54 (patch) | |
| tree | cb7b667bb59efc1732be159a39ef22c9ae28c6d4 /src/math | |
| parent | 019ad98b5337992625327ea07185ad06a9c19169 (diff) | |
| download | go-4607ebc7d897c36687ae4ede3cfd4939c6dd0a54.tar.xz | |
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>
Diffstat (limited to 'src/math')
| -rw-r--r-- | src/math/example_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/math/example_test.go b/src/math/example_test.go index 9fc1967967..a26d8cbe97 100644 --- a/src/math/example_test.go +++ b/src/math/example_test.go @@ -162,6 +162,11 @@ func ExampleLog10() { // 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) |
