Skip to content

Support parsing - #327

Closed
PatrickHaecker wants to merge 1 commit into
JuliaMath:masterfrom
PatrickHaecker:parsing
Closed

PatrickHaecker wants to merge 1 commit into
JuliaMath:masterfrom
PatrickHaecker:parsing

Conversation

@PatrickHaecker

@PatrickHaecker PatrickHaecker commented Jun 17, 2026 •

Copy link
Copy Markdown
Collaborator

Support Base.parse and Base.tryparse for Normed and Fixed.

@kimikage

kimikage commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

The development branch has been moved to v0.9.

I don’t think adding a parser is a bad idea, but we need to discuss which formats to accept.

If there are ambiguities or limitations in the specification, or if it is essentially a reimplementation of parse(Float64, x), I think it’s better to leave that matter to downstream packages or end users.

@kimikage
kimikage marked this pull request as draft September 14, 2026 00:11
Add `tryparse` (and thereby `parse`) for `Fixed` and `Normed` types. The
decimal string is rounded exactly to the nearest representable value, with
ties to even, so the result never suffers from double rounding through an
intermediate float. It works on fixed-width integers for raw types up to 64
bits, which makes it about twice as fast as converting from `Float64`,
allocation-free, and compatible with `--trim`.
@PatrickHaecker

Copy link
Copy Markdown
Collaborator Author

There was a reason why this is useful, but I don't fully remember it. The current state is ported to 0.9 by the agent, but I wasn't really happy with the status and have changed some things, but have not reviewed everything. Currently it does not seem worth the time. I'd invite everyone (including future-me) to reopen this when it's clear what the benefit is.

@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.85057% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.38%. Comparing base (206e68f) to head (e39bb28).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/FixedPointNumbers.jl 98.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #327      +/-   ##
==========================================
+ Coverage   96.85%   97.38%   +0.52%     
==========================================
  Files           7        7              
  Lines         796      879      +83     
==========================================
+ Hits          771      856      +85     
+ Misses         25       23       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants