on a very slow function
Chris Angelico
rosuav at gmail.com
Sun Oct 1 20:38:13 EDT 2017
More information about the Python-list mailing list
Sun Oct 1 20:38:13 EDT 2017
- Previous message (by thread): on a very slow function
- Next message (by thread): on a very slow function
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Oct 2, 2017 at 11:34 AM, Steve D'Aprano <steve+python at pearwood.info> wrote: >> change it to >> >> last = (last**2 + c) % N >> return next > > Better: > > last = (pow(last, 2, N) + (2 % N)) % N > > will almost certainly be faster for large values of last. I think possibly you mean (c % N) in the middle there? Not sure but there ought to be a reference to c somewhere. ChrisA
- Previous message (by thread): on a very slow function
- Next message (by thread): on a very slow function
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list