Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

>  Finv = [pow(fodd, -1, 2**64) for fodd in Fodd]

This is a good trick.  I had already experimented with separating factorials 
into an odd component and a shift count, but failed to get a speed-up because 
the divisions were slow.  Having a table of multiplicative inverses and working 
mod 2**64 bypasses that problem nicely.  Division-free is the way to go :-)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37295>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to