Actually I wanted to get absolute values out of an array and the only way i can think of multiplying the values in the array with (-1) using 'if' loop. But does it work like that? as in:
for (i = 1 ; i <= 10 ; i++) {
if(x[i]<1) {
x[i] = (-1) * x[i];
} else{}
ratio[i] = (x[i]/fx[i]) * 0.5;
}
I am not sure if u can just multiply an integer with an array..or at least, when i do the aboive it didnt produce the results i want, the negatives are still there..
And i realized that this expression if(x[i]<1) does not work, hope someone can help! really appreciate it~ If not, is there another way? Thanks!