Recursion or iteration (was Fibonacci series recursion error)

Chris Angelico rosuav at gmail.com
Tue May 3 09:02:29 EDT 2011


On Tue, May 3, 2011 at 10:49 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Tue, 03 May 2011 21:04:07 +1000, Chris Angelico wrote:
>
>> And that, Your Honour, is why I prefer bignums (especially for integers)
>> to floating point. Precision rather than performance.
>
> I'm intrigued by your comment "especially for integers", which implies
> that you might use bignums for non-integers. Out of curiosity, how would
> you calculate:
>
> sin(sqrt(7)*pi/31)
>
> using bignums?

REXX uses decimal bignums, although I don't have a high-performance
math library (for sin) that uses anything more than IEEE double
precision. If I coded my own sin algorithm in REXX, I could go to
whatever precision memory (and patience) would allow.

Chris Angelico



More information about the Python-list mailing list