Skip to content

Use proper libm power method for f64s #3661

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

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

TheBlueMatt
Copy link
Collaborator

For some reason when attempting to raise floats to powers in scoring we'd converted our f64s to f32s, called libm::powf (on no-std targets), then converted the result back to an f64. libm::pow, however, exists and raises f64s to a power natively.

Here we correct this, using the proper f64-native pow.

While I doubt its related, I went to look if we have any conversion in LDK itself in response to
lightningdevkit/ldk-node#483 (where Android binaries failed to load due to a missing __extenddftf2.

For some reason when attempting to raise floats to powers in
scoring we'd converted our `f64`s to `f32`s, called `libm::powf`
(on no-std targets), then converted the result back to an `f64`.
`libm::pow`, however, exists and raises `f64`s to a power natively.

Here we correct this, using the proper `f64`-native `pow`.

While I doubt its related, I went to look if we have any conversion
in LDK itself in response to
lightningdevkit/ldk-node#483 (where
Android binaries failed to load due to a missing `__extenddftf2`.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Mar 11, 2025

I've assigned @arik-so as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@ldk-reviews-bot ldk-reviews-bot requested a review from arik-so March 11, 2025 19:55
@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@ldk-reviews-bot
Copy link

✅ Added second reviewer: @valentinewallace

@TheBlueMatt
Copy link
Collaborator Author

Honestly, this is trivial.

@TheBlueMatt TheBlueMatt merged commit f10b854 into lightningdevkit:main Mar 12, 2025
25 of 27 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.

3 participants