1 /* Compute the sum of the squares of a vector of signed shorts
2 
3  *  Portable C version
4  * Copyright 2004 Phil Karn, KA9Q
5  * May be used under the terms of the GNU Lesser General Public License (LGPL)
6  */
7 
sumsq_port(signed short * in,int cnt)8 unsigned long long sumsq_port(signed short *in,int cnt){
9   long long sum = 0;
10   int i;
11 
12   for(i=0;i<cnt;i++){
13     sum += (int)in[i] * (int)in[i];
14   }
15   return sum;
16 }
17