View Single Post
ramsey2879
ramsey2879 is offline
#1
Feb27-12, 10:03 AM
P: 891
In:list5 = Import["Composites.csv"]; (*imports a list of odd integers each less than 1000000*)
Timing[f=Compile[{{Caa,_Integer},{S0,_Integer},{S1,_Integer},{Co,_Integer}},
Module[{xCo=Co,xS0=S0,xS1=S1,Temp},While[Temp=Mod[6 xS1-xS0-6,Caa];xCo>0&&Temp>=1,
xS0=xS1;xS1=Temp;xCo--];
xCo]];
count = Length[list5];
list3=Reap[While[count>0,
Caa= list5[[count]];Sow[Caa];Co=Round[(Caa-2)/2];S0=2;S1=3;
So = f[Caa,S0,S1,Co]; Sow[So];
count--]]]
results in red msg:
{3827} in position 1 should be a machine size Integer,
{13067} in position 1 should be a machine size Integer, etc
These are integers from the imported list. I am at loss as how to correct this error. Please help.
PS when I switched the positions of Caa and Co in the compiled function, I get in red {1913} in position 1 should be a machine sized integer, etc.
Phys.Org News Partner Science news on Phys.org
SensaBubble: It's a bubble, but not as we know it (w/ video)
The hemihelix: Scientists discover a new shape using rubber bands (w/ video)
Microbes provide insights into evolution of human language