Jon Perry on Mon, 5 Aug 2002 18:02:42 +0100

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

Function return value

Why does my iscube() function:

iscube(n)=local(f,retVal);f=factor(n)[,2];retVal=true;for (j=1,length(f),if

need to be tested with ==true?


for (s=1,100,if (iscube(s)==true,print1(s,",")))

works, but:

for (s=1,100,if (iscube(s),print1(s,",")))

doesn't, unlike the behaviour of inbuilt functions such as issquare().

Jon Perry
BrainBench MVP for HTML and JavaScript