John Duncan on Fri, 02 Sep 2022 22:36:06 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

setsearch()


Dear all,

I would expect the function copied below to return a vector of zeros of length n, for any n. But it doesn't (for me, running Version 2.13.4), for n>9. Can someone explain to me why? and how to "fix" it?

Faithfully,


John

f(n)=
{
local(v,ans);
v=vector(n,i,Str(i));
ans=vector(n,i,setsearch(v,v[i],1));
ans;
}