Skip to content

Conversation

tannergooding
Copy link
Member

@tannergooding tannergooding commented Jul 17, 2025

This makes progress towards #81500

Copy link
Contributor

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

@tannergooding tannergooding marked this pull request as ready for review September 18, 2025 14:03
@Copilot Copilot AI review requested due to automatic review settings September 18, 2025 14:03
Copy link
Contributor

@Copilot Copilot AI left a 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

@tarekgh tarekgh added this to the 11.0.0 milestone Sep 18, 2025
Copy link
Member

@tarekgh tarekgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tannergooding tannergooding merged commit ebc772c into dotnet:main Sep 18, 2025
88 checks passed
@tannergooding tannergooding deleted the fix-81500 branch September 18, 2025 18:52
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.

4 participants