[issue40446] pow(a, b, p) where b=int((p-1)/2) spits out gibbrish for big p

Ammar Askar report at bugs.python.org
Thu Apr 30 01:41:37 EDT 2020


Ammar Askar <ammar at ammaraskar.com> added the comment:

And just to add on, the reason this gives you the correct result in Python 2 is that `/` performs integer division whereas in Python 3 the `/` operator provides a float as a result.

See https://docs.python.org/3/howto/pyporting.html#division for more details.

----------
nosy: +ammar2
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40446>
_______________________________________


More information about the Python-bugs-list mailing list