Skip to content

[Proposal] Adds TextSpan.AsReadOnlySpan() & numerics exponential parser#168

Closed
aka-nse wants to merge 4 commits intodatalust:devfrom
aka-nse:feature/numerics-exponential
Closed

[Proposal] Adds TextSpan.AsReadOnlySpan() & numerics exponential parser#168
aka-nse wants to merge 4 commits intodatalust:devfrom
aka-nse:feature/numerics-exponential

Conversation

@aka-nse
Copy link
Copy Markdown
Contributor

@aka-nse aka-nse commented Aug 30, 2025

Hello.

This pull request introduces 2 related features:

  • TextSpan.AsReadOnlySpan():
    provides the foundation for using modern span-based APIs, paving the way for improved performance.
  • support for parsing exponential notation in numeric parsers:
    the changes enhance the existing numerics parsing capabilities to correctly handle numbers expressed in exponential (scientific) format, such as 1.23e4 or -5.67E-8.

Key Changes

  • Added parsing logic for exponential notation in the numeric parsers.
  • Updated relevant tests to cover exponential number formats.
  • Improved documentation and comments for clarity regarding exponential parsing.

Motivation

Supporting exponential notation is essential for applications that process scientific or engineering data, where such formats are commonly used. This update ensures that the library can robustly handle a wider range of numeric inputs.

Impact

  • External package dependency: New reference to System.Memory is introduced only for '$(TargetFramework)'=='netstandard2.0'.
  • Backward compatible: Existing numeric parsing remains unaffected.
  • No breaking changes to public APIs.

Please let me know if you need a more detailed or customized description.
Thank you.

@nblumhardt
Copy link
Copy Markdown
Member

Hi @aka-nse, thanks for sending this.

In the interests of keeping Superpower tight and focused, we're not keen to add exponential number support at this stage.

AsReadOnlySpan() looks good, and adds a capability that can't be easily patched in, so a PR with that change only (and some test coverage) would be welcome if you're interested.

Thanks again!

@aka-nse
Copy link
Copy Markdown
Contributor Author

aka-nse commented Sep 4, 2025

Thank you for your responseThank you for your response.

I understood the direction.
Therefore I open a new pull request #169 which contains a part of this PR, including only TextSpan.AsReadOnlySpan()< and I'll closes this PR.

@aka-nse aka-nse closed this Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants