Skip to content

Correct midpoint rounding in binary floating-point conversions - #138242

Open
tannergooding wants to merge 2 commits into
dotnet:mainfrom
tannergooding:tannergooding-pr-138126-review
Open

tannergooding wants to merge 2 commits into
dotnet:mainfrom
tannergooding:tannergooding-pr-138126-review

Conversation

@tannergooding

Copy link
Copy Markdown
Member

Summary

  • Correct UTF-8 parsing's digit-boundary and discarded-tail handling, and normalize retained fractional zeros before binary conversion.
  • Apply the same normalization to temporary Decimal128 conversion buffers, with midpoint and boundary regression coverage.

Relates to #134839

Local performance

Release x64, PGO optimization disabled. Utf8Parser.TryParse(double, "123.456") measured 25.4 ns on base and 30.9 ns on this branch; a zero-tail midpoint input measured 93.3 ns and 37.0 ns, respectively. The host was under substantial background load, and results varied between runs; these measurements are directional, not a general performance claim.

Note

This PR description was drafted with GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants