]> Cypherpunks repositories - gostls13.git/commitdiff
math/big: document that Sqrt doesn't set Accuracy
authorAlberto Donizetti <alb.donizetti@gmail.com>
Fri, 20 Mar 2020 18:13:07 +0000 (19:13 +0100)
committerRobert Griesemer <gri@golang.org>
Fri, 20 Mar 2020 19:24:37 +0000 (19:24 +0000)
Document that the Float.Sqrt method does not set the receiver's
Accuracy field.

Updates #37915

Change-Id: Ief1dcac07eacc0ef02f86bfac9044501477bca1c
Reviewed-on: https://go-review.googlesource.com/c/go/+/224497
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/big/float.go
src/math/big/sqrt.go

index b3c329520141f112f9216ffc0b1d39fe40c7b9cc..da964eef3e8dc4dc4489fb7517424906900fc5cb 100644 (file)
@@ -224,7 +224,9 @@ func (x *Float) Mode() RoundingMode {
        return x.mode
 }
 
-// Acc returns the accuracy of x produced by the most recent operation.
+// Acc returns the accuracy of x produced by the most recent
+// operation, unless explicitly documented otherwise by that
+// operation.
 func (x *Float) Acc() Accuracy {
        return x.acc
 }
index 53403aa41d7278b884061130552fd2d6e9132117..ac2094f28e8a4601db7b9eb77777412c8146461b 100644 (file)
@@ -14,7 +14,8 @@ var (
 //
 // If z's precision is 0, it is changed to x's precision before the
 // operation. Rounding is performed according to z's precision and
-// rounding mode.
+// rounding mode, but z's accuracy is not computed. Specifically, the
+// result of z.Acc() is undefined.
 //
 // The function panics if z < 0. The value of z is undefined in that
 // case.