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 clippy warnings #116

Merged
merged 4 commits into from
Nov 16, 2020
Merged

Conversation

troublescooter
Copy link
Collaborator

@troublescooter troublescooter commented Nov 11, 2020

This pr is a mixed bag of stuff. Its main target is to fix the enormous amount of clippy lints, but also to fix some wrong special case formulas in the Gamma function, as well as introduce the crate approx to get a coherent handling of floating-point comparisons. Lastly it bumps dependencies.

In short, there are three possible ways to compare floating-point numbers: By absolute difference, by relative difference and by ulps, which are explained in the approx doc links. Absolute difference is almost never what one would want, unless some degenerate case occurs like comparing with 0. This pr introduces comparisons by ulps to be the default for inputs, while relative precision would make more sense for outputs when adapting the tests to the new changes and picking a sensible precision to target. This would fix most of the remaining 237 clippy warnings.

Two clippy warnings are silenced by default: Excessive precision and too many single-character variable names, because I didn't have access to the papers describing the algorithms and thus couldn't check whether they could have been named more descriptively.

@troublescooter
Copy link
Collaborator Author

I also removed the deprecated structs that were once scheduled for removal in #82 .

…oat comparisons

fix: eliminate almost all remaining clippy warnings, except for those in the tests
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.

1 participant