Recursion or iteration (was Fibonacci series recursion error)

Chris Angelico rosuav at gmail.com
Tue May 3 07:04:07 EDT 2011


On Tue, May 3, 2011 at 8:32 PM, Dave Angel <davea at ieee.org> wrote:
> What I'm surprised at is that nobody has pointed out that the logn version
> is also generally more accurate, given traditional floats. Usually getting
> the answer accurate (given the constraints of finite precision
> intermediates) is more important than performance, but in this case they go
> hand in hand.

And that, Your Honour, is why I prefer bignums (especially for
integers) to floating point. Precision rather than performance.

Chris Angelico



More information about the Python-list mailing list