Skip to content

math/big: Float.Append and Float.Text do not set Accuracy #18650

@mpvl

Description

@mpvl

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.7 darwin/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH=""
GORACE=""
GOROOT="/usr/local/go1.7"
GOTOOLDIR="/usr/local/go1.7/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

Calling Append and Text on big.Float and determine the accuracy of the result.
https://play.golang.org/p/gxa_HDy-Ul

What did you expect to see?

I expected Acc to give the accuracy of the last operation, as documented, in this case being Text or Append.

There currently seems to be no way to determine the accuracy of a printed string. If this cannot be supported, an alternative solutions would be: a) have a separate method to get the digits of a float, b) have a big.Decimal that allows to be converted to that would allow getting the information in a similar way as is possible with SetPrec and the like in big.Float.

What did you see instead?

It does not.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions