[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Help with bigbnum

Mark Day

5/4/2007 7:35:00 PM

On May 4, 2007, at 10:36 AM, Jason Roelofs wrote:

> You do realize the magnitude of number you're trying to calculate?
> There IS
> a limit to how big even BigNum can go before deciding to crap out.
> I'd like
> to see someone try this in Lisp. If that interpreter can't handle
> it, then
> no language can.

Python 2.5 appears to have handled the expression easily enough (3-4
seconds on my iMac Intel Core Duo). Converting it to a string for
display seems to be taking quite a long time, which isn't too
surprising since it should have nearly 2 million decimal digits
(according to log10(n)).

-Mark

> Jason
>
> On 5/4/07, Victor Reyes <victor.reyes@gmail.com> wrote:
>>
>> I am trying to use the following computation: 232582656(232582657-1)
>>
>> n = (2**32582656) * (2**32582657 - 1)
>>
>> I am getting the msg:
>>
>> perf.rb:5: warning: in a**b, b may be too big Infinity
>>
>> Any help will be appreciated.
>>
>> Thank you
>>
>> Victor
>>