Skip to content

As F64/AS i128#726

Merged
paupino merged 1 commit intopaupino:v1from
rollo-b2c2:as_f64
Mar 14, 2026
Merged

As F64/AS i128#726
paupino merged 1 commit intopaupino:v1from
rollo-b2c2:as_f64

Conversation

@rollo-b2c2
Copy link
Copy Markdown
Contributor

@rollo-b2c2 rollo-b2c2 commented Apr 30, 2025

#727

Sorry, I know this is failing. Haven't had the chance to build it. Will put the function in the right place when I get a chance.

But will take a look. Was just a demo

@paupino
Copy link
Copy Markdown
Owner

paupino commented Jun 14, 2025

I think what you're trying to achieve is right - I think for this PR you just need to take the arguments outside of the ToPrimitive implementation and treat them as a direct impl function.

@paupino paupino changed the base branch from master to v1 March 14, 2026 03:10
Adds two new public methods on Decimal:
- as_i128(): infallible equivalent of ToPrimitive::to_i128()
- as_f64(): infallible equivalent of ToPrimitive::to_f64()

The existing ToPrimitive methods now delegate to these.

Fixes: move methods to impl Decimal (not inside impl ToPrimitive)
Fixes: stray semicolon causing as_f64() to not return in scale==0 branch
Fixes: leftover Some() wrappers in as_f64() body

Closes paupino#727
@paupino paupino merged commit 5345e16 into paupino:v1 Mar 14, 2026
16 checks passed
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