Re: [Nolug] In case you wanted to know how big 2 to the 3,000,000 is...

From: Friedrich Gurtler <fgurtler_at_tulane.edu>
Date: Thu, 01 Jul 2004 14:08:29 -0500
Message-ID: <40E4612D.1010508@tulane.edu>

>
>
>I tried it in perl, the output i got was 3.
>
>3 is the length of the string 'inf', hahaha...
>
>ray
>

>Surprise..... 131 seconds. (Roughly under 3 minutes.)
>
>I got the same result
>length: 903090
>time: 131
>

I tried it in perl too, but got rather different results.

use Math::BigInt lib=>'GMP';
print Math::BigInt->new('1')->blsft(3000000, 2)->length() ."\n";

fritz $ time perl test.pl
903090

real 0m10.035s
user 0m8.320s
sys 0m0.160s

10 seconds on a 667 Mhz Mac. It is all about how smart your algorithm
is. (Or perhaps Macs are that powerful! ;-) )

___________________
Nolug mailing list
nolug@nolug.org
Received on 07/01/04

This archive was generated by hypermail 2.2.0 : 12/19/08 EST