-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
J2N.Numerics: Extended Span<char> support to net45 and netstandard2.0 #53
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…mber types and tests
…ulture for basic tests to eliminate issues with localized negative symbols.
…hat were in the original dotnet runtime code to reduce allocations
…ariant culture for basic tests to eliminate issues with localized negative symbols." This reverts commit c20e909.
…r all number types and tests" This reverts commit 8a1255f.
…an casting to ReadOnlySpan<char> to support netstandard2.0 and net45
…latforms that don't support ReadOnlySpan<char> on Parse/TryParse methods.
…ixed conditional compilation issues that made the code less than optimal on modern platforms
…ing the task to .NET
…han passing the task to .NET" This reverts commit c6ffa1d.
…han passing the task to the BCL. This allows us to support ReadOnlySpan<char> in net45 and netstandard2.0 without performance degradation.
…g(): Use ValueStringBuilder when supported to reduce heap allocations
…l formatting code from DoubleExtensions and SingleExtensions. Refactored to allow a TryFormat version.
…rms that support Span<char> + tests
…se with raw float and double data types + tests
…riginal code from dotnet runtime + adapted Harmony tests to call them
… platforms older than .NET 6.0
…irtual with a substandard (but functional) implementation that can be overridden. Made all TryFormat() methods public and added documentation.
…. Added support for parsing both integral type and real type specifiers into any data type (for decimal numbers only). Added support for parsing hexadecimal numbers with prefix "0x". Updated inline docs.
…char> and radix (without startIndex and length) + tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New APIs added for
netstandard2.0
andnet45
targets onlyParse()
/TryParse()
overloads that acceptReadOnlySpan<char>
onnet6.0
APIs added <
net6.0
New APIs
New Features
AllowTypeSpecifier
on integral typesAllowHexSpecifier
) allows 'D', 'd', 'F', 'f', 'M', 'm', 'UL', 'Ul', 'uL', 'ul', 'LU', 'Lu', 'lU', or 'lu' after the numberAllowHexSpecifier
) allows 'UL', 'Ul', 'uL', 'ul', 'LU', 'Lu', 'lU', or 'lu' after the numberAllowTypeSpecifier
on decimal types to include 'UL', 'Ul', 'uL', 'ul', 'LU', 'Lu', 'lU', or 'lu' after the number in addition to 'D', 'd', 'F', 'f', 'M', and 'm'System.Memory
fornetstandard2.0
andnet45
(primarily to allowSpan<T>
andReadOnlySpan<T>
support)Optimizations
ValueStringBuilder
ported from .NET 6.0 to replaceStringBuilder
in number formattersCode Cleanup
FEATURE_READONLYSPAN
and normalizes all of the code to useFEATURE_SPAN