<

Question: map VS subsop

Question:map VS subsop

casperyc 957 Maple

Hi,

I am just wondering, if dealing with 'large' numbers,

which one is better? or which is approiate?

+++++++++++++++++++++++++++

restart:
a:=[12,34,56,78,100000];
t:=time():map(i->Power(i,43214342341) mod 5423524532,a);time()-t;
+++++++++++++++++++++++++++

restart:

a:=[12,34,56,78,100000];

t:=time():
for i to nops(a) do
a:=subsop(i = `mod`(Power(a[i],43214342341),5423524532),a):
od:
a;time()-t;

+++++++++++++++++++++++++++

I have tested in my other procedure with large numers, the reult is that 'subsop' is faster.

I wonder if it is always the case?


what's the difference?


Thanks.

 

casper

Please Wait...