-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Optimize BigInteger.ToString
for large decimal string
#112178
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 |
src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs
Outdated
Show resolved
Hide resolved
efcf4e1
to
bf75784
Compare
bf75784
to
86f4a53
Compare
2abfe84
to
f825641
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (3)
src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs:797
- [nitpick] The variable name 'digitRatio' is ambiguous. It should be renamed to something more descriptive like 'logBase2ToBase1E9Ratio'.
const double digitRatio = 1.070328873472;
src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs:933
- [nitpick] The method name 'BigIntegerToBase1E9' could be more descriptive. Consider renaming it to 'ConvertBigIntegerToBase1E9'.
private static void BigIntegerToBase1E9(ReadOnlySpan<uint> bits, Span<uint> base1E9Buffer, out int leadingWritten)
src/libraries/System.Runtime.Numerics/tests/BigInteger/BigIntegerToStringTests.cs:13
- The variable 'result' is initialized to 'null' but is not explicitly set in the 'catch' block, which could lead to a 'NullReferenceException'. Ensure 'result' is properly handled in the 'catch' block.
string result = null;
This PR is a counterpart to #55121. divide-and-conquer algorithm
Number.FormatBigInteger()
can run inThe computational complexity of division have been improved by #96895.
Benchmark
Code