-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update BigInteger and Complex to support UTF8 parsing and formatting #117745
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
Conversation
Tagging subscribers to this area: @dotnet/area-system-numerics |
d543f92
to
f79f0ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds UTF-8 parsing and formatting support for BigInteger and Complex types as part of progress towards #81500. The changes implement the IUtf8SpanFormattable and IUtf8SpanParsable interfaces for both types.
Key changes:
- Added UTF-8 parsing methods (Parse and TryParse overloads) for BigInteger and Complex
- Added UTF-8 formatting support (TryFormat overloads) for BigInteger and Complex
- Updated internal parsing/formatting logic to work generically with character types
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/libraries/System.Runtime.Numerics/tests/ComplexTests.cs | Adds UTF-8 test coverage for Complex parsing methods |
src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs | Adds UTF-8 test coverage for BigInteger parsing methods and cleans up unused imports |
src/libraries/System.Runtime.Numerics/tests/BigInteger/BigIntegerToStringTests.cs | Adds UTF-8 test coverage for BigInteger formatting methods |
src/libraries/System.Runtime.Numerics/src/System/ThrowHelper.cs | Adds ThrowUnreachableException helper method |
src/libraries/System.Runtime.Numerics/src/System/Numerics/Complex.cs | Implements UTF-8 parsing and formatting for Complex type |
src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs | Implements UTF-8 parsing and formatting for BigInteger type |
src/libraries/System.Runtime.Numerics/src/System/Number.Polyfill.cs | Updates helper methods to support both UTF-8 and UTF-16 character types |
src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs | Refactors parsing/formatting logic to work generically with character types |
src/libraries/System.Runtime.Numerics/src/System.Runtime.Numerics.csproj | Updates project to use generic ValueStringBuilder |
src/libraries/System.Runtime.Numerics/ref/System.Runtime.Numerics.cs | Adds public API surface for UTF-8 methods |
src/libraries/Common/src/System/Text/ValueStringBuilder_1.cs | New generic version of ValueStringBuilder to support both UTF-8 and UTF-16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This makes progress towards #81500