Number-Theory-Python icon indicating copy to clipboard operation
Number-Theory-Python copied to clipboard

adds Euler Criterion method

Open egealpay opened this issue 7 years ago • 8 comments

Hi,

I made a small contribution by adding Euler's Criterion

egealpay avatar Jan 17 '18 13:01 egealpay

Thanks - Give me a day or so to look at the code and then figure out how to merge it.

Rob Campbell

On Jan 17, 2018, at 8:37 AM, Ege Alpay [email protected] wrote:

Hi,

I made a small contribution by adding Euler's Criterion

You can view, comment on, or merge this pull request online at:

https://github.com/Robert-Campbell-256/Number-Theory-Python/pull/1 https://github.com/Robert-Campbell-256/Number-Theory-Python/pull/1 Commit Summary

adds Euler Criterion method File Changes

M Readme.md https://github.com/Robert-Campbell-256/Number-Theory-Python/pull/1/files#diff-0 (1) M numbthy.py https://github.com/Robert-Campbell-256/Number-Theory-Python/pull/1/files#diff-1 (448) Patch Links:

https://github.com/Robert-Campbell-256/Number-Theory-Python/pull/1.patch https://github.com/Robert-Campbell-256/Number-Theory-Python/pull/1.patch https://github.com/Robert-Campbell-256/Number-Theory-Python/pull/1.diff https://github.com/Robert-Campbell-256/Number-Theory-Python/pull/1.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Robert-Campbell-256/Number-Theory-Python/pull/1, or mute the thread https://github.com/notifications/unsubscribe-auth/APw8njcq2Fy-zHUxDKdwu1QjoKtGzfFeks5tLfeIgaJpZM4RhWfn.

Robert-Campbell-256 avatar Jan 21 '18 01:01 Robert-Campbell-256

Ege,

OK - Only one issue. When you worked with the code your editor made a number of minor changes - mostly just changing the number of leading spaces to indent, as well as some other formatting changes. Unfortunately this is flagged by diff as though most of the file was changed - not just a few lines - and makes it harder to check the changes.

Could I ask you to pull a fresh copy of the file and add your changes to it without changing the formatting?

Rob Campbell

Robert-Campbell-256 avatar Jan 22 '18 01:01 Robert-Campbell-256

Will add this Euler Criterion function without adding new empty line and spaces in a new PR.

CanoeFZH avatar Oct 09 '19 10:10 CanoeFZH

https://github.com/Robert-Campbell-256/Number-Theory-Python/pull/5

CanoeFZH avatar Oct 09 '19 13:10 CanoeFZH

OK - Give me a day or so to look at the code and accept the pull.

Robert-Campbell-256 avatar Oct 12 '19 15:10 Robert-Campbell-256

Looks good. I'll merge it today, although I will then come back and make the change "a ** ((p - 1) / 2) % p" --> "pow(a,(p-1)/2,p)" to ensure that fast exponentiation is used.

I feel a little bad, because this is essentially the same reasonable addition that egealpay recommended last year. I wish there was a way to give him joint credit for the pull. (Sigh ... had I been more energetic then I could have just accepted it and then re-edited to fix the minor formatting issues. Live and learn.)

Robert-Campbell-256 avatar Oct 13 '19 15:10 Robert-Campbell-256

Or, well, "a ** ((p - 1) / 2) % p" --> "pow(a,(p-1)//2,p)" actually. (Duh, Python 3 ...)

Robert-Campbell-256 avatar Oct 13 '19 16:10 Robert-Campbell-256

Man, don't be that sad. It's important things are moving on. I was also a part time learner who is somehow has some interests on numbers. It' not important who is got merged. Thanks for your sharing. I like the document and the code you write.

CanoeFZH avatar Oct 15 '19 03:10 CanoeFZH