This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
#define MAX_SIZ 100
static double per[MAX_SIZ];
double* c_percents(double* arr, int siz)
{
if( siz > MAX_SIZ) siz = MAX_SIZ;
double sum = 0.0;
int i;
for( i = 0; i < siz; ++i ) {
sum += arr[i];
}
sum = 100.0 / sum;
for( i = 0; i < siz; ++i ) {
per[i] = arr[i] * sum;
}
return per;
}