Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strconv: rounding #55056

Closed
JRoper18 opened this issue Sep 13, 2022 · 1 comment
Closed

strconv: rounding #55056

JRoper18 opened this issue Sep 13, 2022 · 1 comment

Comments

@JRoper18
Copy link

JRoper18 commented Sep 13, 2022

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

$ go version
go version go1.19.1 darwin/arm64

Does this issue reproduce with the latest release?

This is the latest re

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="arm64"
GOBIN=""
GOCACHE=
GOENV=
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/jroper/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/jroper/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.19.1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/ky/_xmwdrp16cg45kk2znpb0xqc0000gn/T/go-build2189227028=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

See https://go.dev/play/p/8_0ETuSnOcj
I used the strconv to convert a string of a (very large) float to a float.

What did you expect to see?

I was hoping to either see the original value, or an error if some floating point precision had been lost. For the example provided, I hoped that either 9999999999999905 would be the returned number, or that I would get an error.

What did you see instead?

9999999999999904, and no error.

@JRoper18 JRoper18 changed the title affected/package: bug/feature? strconv large floating-point parsing Sep 13, 2022
@seankhliao
Copy link
Member

working as intended, see function docs.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2022
@JRoper18 JRoper18 changed the title bug/feature? strconv large floating-point parsing strconv bug/feature? large floating-point parsing Sep 13, 2022
@seankhliao seankhliao changed the title strconv bug/feature? large floating-point parsing strconv: rounding Sep 13, 2022
@golang golang locked and limited conversation to collaborators Sep 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants