Skip to content

Conversation

@konsumlamm
Copy link
Contributor

Avoids doing mod twice.

I also swapped a.modulo(modulus) and modulus in invmod, to skip the first iteration (otherwise q would always be zero in the first iteration, since a.modulo(modulus) < modulus).

@konsumlamm
Copy link
Contributor Author

Hmm, looks like there's a Nim 1.4 bug...

@konsumlamm
Copy link
Contributor Author

I managed to work around the bug, but I have no idea what caused it.

Copy link
Contributor

@dlesnoff dlesnoff left a comment

Choose a reason for hiding this comment

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

These changes seems fine to me.

@narimiran narimiran merged commit 29d9761 into nim-lang:master Jan 31, 2022
@konsumlamm konsumlamm deleted the modulo branch January 31, 2022 14:42
@konsumlamm konsumlamm mentioned this pull request Dec 4, 2023
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.

3 participants