Skip to content
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

fix(math): fix edge cases of ln and pow #533

Conversation

AndrewWestberg
Copy link
Collaborator

Even though we shouldn't hit these cases in doing math for cardano, it's a good practice to add them to the math library in case they are needed for the future.

@AndrewWestberg
Copy link
Collaborator Author

AndrewWestberg commented Oct 26, 2024

@abailly

abailly
abailly previously approved these changes Oct 28, 2024
Copy link

@abailly abailly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great we have more tests and better error handling on key functions. Commented with some suggestions, might be done in a later PR but given how important those low-level libraries are for the rest of the stack, we should delay for too long to provide strong correctness guarantees.

pallas-math/src/math.rs Show resolved Hide resolved
pallas-math/src/math.rs Outdated Show resolved Hide resolved
pallas-math/src/math.rs Outdated Show resolved Hide resolved
pallas-math/src/math_malachite.rs Show resolved Hide resolved
pallas-math/src/math_malachite.rs Outdated Show resolved Hide resolved
pallas-math/src/math_malachite.rs Show resolved Hide resolved
pallas-math/src/math.rs Outdated Show resolved Hide resolved
pallas-math/src/math.rs Outdated Show resolved Hide resolved
@AndrewWestberg AndrewWestberg force-pushed the 529-the-natural-logarithm-of-a-0-fixeddecimal-should-not-be-0 branch from 4d879da to 96380bc Compare October 30, 2024 13:16
@AndrewWestberg AndrewWestberg force-pushed the 529-the-natural-logarithm-of-a-0-fixeddecimal-should-not-be-0 branch from 96380bc to 4f78f8c Compare October 30, 2024 23:09
@AndrewWestberg AndrewWestberg requested review from scarmuega and removed request for scarmuega October 30, 2024 23:26
@scarmuega
Copy link
Member

Not mandatory, but since Rust 1.80, the std::sync::LazyLock feature has been stabilized and can be used to replace the once_cell approach and avoid the extra dependency (unless there's some specific requirements that I'm missing).

@AndrewWestberg AndrewWestberg merged commit 2db4170 into main Oct 31, 2024
7 checks passed
@AndrewWestberg AndrewWestberg deleted the 529-the-natural-logarithm-of-a-0-fixeddecimal-should-not-be-0 branch October 31, 2024 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants