<quote who="Friedrich Gurtler">
> 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! ;-) )
>
It has to do with the libraries you use. In the php code that was posted,
it was calling a bcmath function, which isn't compiled in by default. The
perl code also uses a similar library (Math::BigInt). The python code was
not using the equivalent function, which is why it took ages.
-- Alex McKenzie alex@boxchain.com http://boxchain.com ___________________ Nolug mailing list nolug@nolug.orgReceived on 07/01/04
This archive was generated by hypermail 2.2.0 : 12/19/08 EST