Skip to content

Preserve precision when reading float slice flags - #510

Open
a3ylf wants to merge 1 commit into
spf13:masterfrom
a3ylf:fix/float-slice-precision
Open

a3ylf wants to merge 1 commit into
spf13:masterfrom
a3ylf:fix/float-slice-precision

Conversation

@a3ylf

@a3ylf a3ylf commented Sep 16, 2026 •

Copy link
Copy Markdown

GetFloat32Slice, GetFloat64Slice, and SliceValue.GetSlice round values through six-decimal formatting. For example, 1e-10 becomes zero even though parsing stored it correctly. Use the same lossless formatting as the scalar float flags, with the appropriate bit size.

Regression tests cover defaults and parsed arguments, fractional values, tiny values, representable extremes, and signed zero. go test -race ./... and the configured golangci-lint checks pass.

@CLAassistant

CLAassistant commented Sep 16, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants