Faster Recursive Fibonacci Numbers

harrismh777 harrismh777 at charter.net
Fri May 20 02:26:47 EDT 2011


Chris Angelico wrote:
> I believe the 'bc' command-line calculator can do a-p non-i, and I
> know REXX can

  Yes, bc is wonderful in this regard. Actually, bc does this sort of 
thing in 'circles' around Python. This is one of Python's weaknesses for 
some problem solving... no arbitrary precision. And its not just that bc 
does arbitrary precision--- its that it does it fast!

Actually, it should be relatively easy to incorporate parts of bc into 
Python as C extensions. On the other hand, when needing specialized math 
work from bc, its probably just better to use bc and leave Python alone.

On the other hand, most of the time (and I mean 99.999% of the time) 
floats are going to work just fine... usually folks don't even need 
doubles....   :)

With fifteen or twenty digits of PI we can calculate the circumference 
of the visible universe to within the width of a proton... er, I mean 
hadron... and you know what... how many folks need to do that anyway??


Don't get me wrong... I absolutely love playing around with bignums, but 
then, I'm a math geek...    ;-)



kind regards,
m harris






More information about the Python-list mailing list