Open
Conversation
thomwiggers
requested changes
Oct 12, 2020
- let mut i = two;
+ let mut i = if *self % two == zero { two } else { one };
* Implement signed (integer) factorial
* Implement signed (integer) double factorial
* Make GSL optional in float double factorial
ece0ec6 to
0500498
Compare
Contributor
Author
|
I'm sorry I left this hanging for so long. I also realize now that this is two things in one: all the double factorial changes, and introducing distinction for (un)signed factorial. Let me know if I should leave that out. |
Owner
|
Hi, I've also left this one hanging for a very long time; I forgot about this and when the #9 merge request woke me up it seemed to have a bit of a higher priority. Do you think you can rebase this PR on top of the prime swing algorithm changes? |
|
I'm not sure if this is a good idea. Negative factorials have many conflicting definitions, so choosing just 1 as "the standard" is bad practice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements:
I also implemented supertraits to clean up the trait proliferation (I think it's done properly).
Things this PR still needs:
- [ ] Some structuring of unit tests, maybe grouping within submodules for (double) factorial?- [ ] Integration tests to make sure the supertraits work, if you want to keep the supertraits.