Hi Couturier,

I also want to say thank you. That vector expression is a surprising rediscovery for me, too.

--Hideo

P.S.

For my curiosity, I have compared the speed of Couturier's vector and If statement.

////////////////////////////
sec;
range r1=1, r2=2;
r1=uniform(100000);
r2=r1>0.5?1:0;
sec -e time;
type -a Vector: $(time) sec;
//
window -t wks;
sec;
range r1=1, r2=2;
r1=uniform(100000);
for(ii=1; ii<=100000; ii++) {
if(r1[ii]>0.5) r2[ii]=1; else r2[ii]=0;
}
sec -e time;
type -a IF: $(time) sec;
Vector: 0.188 sec
IF: 13.338 sec

So, the conditional operator for vectors is 70(=13.34/0.19) times faster!