#include <math.h>
#include "mathlink.h"
/* totals the numbers and calculates the square root */
double f(double* list, int len)
{
double sum;
while(len--)
{
sum += *list++;
/* check for the abort */
if(MLAbort) return (double)0;
}
return sqrt(sum);
}