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 factorial implementation #17

Merged
merged 5 commits into from
Nov 23, 2023

Conversation

marcantoinem
Copy link
Contributor

First of all, I'm really sorry for the faulty implementation, but this fix it. See #16

There's no performance degradation with this PR is it essentially the same, but now the algorithm always use prime swing because the implementation is a bit more efficient for small numbers. (Before it was using the naive algorithm to calculate number below 1200)
lines

Copy link
Owner

@thomwiggers thomwiggers left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your contribution

+ Clone
+ FromPrimitive
+ ToPrimitive
+ Shl<u32, Output = T>,
Copy link
Owner

Choose a reason for hiding this comment

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

This changes the API, so I suppose that we have to bump to 0.4.0 now.

@thomwiggers thomwiggers merged commit 72cc88b into thomwiggers:main Nov 23, 2023
1 check passed
@thomwiggers
Copy link
Owner

I would also like to note that the blame rests as much on my shoulders, I really should have tested this better. Fortunately, we learn as we go and the unit tests are now a lot better.

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