-
Notifications
You must be signed in to change notification settings - Fork 25
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
When a user specifies an invalid carry value (bigger than the multipl… #65
Conversation
…icator), it is moduloed by the multiplicator.
Also, closes #63 |
@Shimuuar by any chance, did you have the time to look at this PR? |
I didn't sorry. Hopefully I'll do it this week |
I finally got to review of patch. This is indeed a bug and change have low impact. By default generator is initiialized with fixed carry One thing. Thanks for catching this! |
Good catch, I think I took the other value from the "non complementary" version of mwc256, here : #33, because at the time I was also investigating differences between the 2 algorithms, and trying to understand which of the 2 was implemented here (btw, I think here it is the complementary version that is implemented after all) I'll update the comments to use the right hexa which is |
The comments are fixed now! |
Actually proof could be simplified and generalized to arbitrary
therefore |
Right, this is a more general formulation. Do you mean we should update the comments? In the code, I liked having actual numbers because IMO it makes it easier to follow the reasonning. |
As you wish. I plan to merge this commit, cherry pick optimizations from #66, and make 0.14 release tomorrow. |
Ok, I'll add a commit to mention that the proof holds for any Word32 aa, but keep the rest as it is now. |
Rebased and merged! Sorry for delay. I'll need to update documentation as well I think. Also please keep #66 open for a while |
…han the multiplicator : force the carry value to be smaller than the multiplicator by using modulo.
Makes the implementation conform to the algorithm as described here.
Might be seen as a breaking change for users specifying out-of-range values for the carry, because they will get different results than before.