Skip to content
Prev 207246 / 398503 Next

Optimizing C code

Thanks both of you.
So isn't the line 9 useless ? If either x[i] or y[i] are NA, then dev 
will be NA and !ISNAN(dev) will detect it...
Sothe loop cool be

8.    for(i = 0 ; i < taille ; i++) {
10.        dev = (x[i] - y[i]);
11.        if(!ISNAN(dev)) {
12.          dist += dev * dev;
13.          count++;
15.      }
16. }

No ?

Christophe