aboutsummaryrefslogtreecommitdiff
path: root/src/math/big/float.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2024-06-04 15:14:39 -0700
committerGopher Robot <gobot@golang.org>2024-06-06 15:46:54 +0000
commit1831437f197d43608c8086dc42530a89d975aba2 (patch)
tree31ba80a5152e02ec7aa280ae6d4c807b0ca95897 /src/math/big/float.go
parent45967bb18e04fa6dc62c2786c87ce120443c64f6 (diff)
downloadgo-1831437f197d43608c8086dc42530a89d975aba2.tar.xz
math/big: better doc string for Float.Copy, add example test
Fixes #66358. Change-Id: Ic9bde88eabfb2a446d32e1dc5ac404a51ef49f11 Reviewed-on: https://go-review.googlesource.com/c/go/+/590635 Auto-Submit: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Diffstat (limited to 'src/math/big/float.go')
-rw-r--r--src/math/big/float.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/math/big/float.go b/src/math/big/float.go
index 0a2887cb5f..51d5574781 100644
--- a/src/math/big/float.go
+++ b/src/math/big/float.go
@@ -672,9 +672,8 @@ func (z *Float) Set(x *Float) *Float {
return z
}
-// Copy sets z to x, with the same precision, rounding mode, and
-// accuracy as x, and returns z. x is not changed even if z and
-// x are the same.
+// Copy sets z to x, with the same precision, rounding mode, and accuracy as x.
+// Copy returns z. If x and z are identical, Copy is a no-op.
func (z *Float) Copy(x *Float) *Float {
if debugFloat {
x.validate()