I have this method that returns a value used in matrix triangularization routine
float **trian(int n, float **Xy)
{
int i,row,col;
float **sign = 1;
for ( i = 0; i < n; i++) {
int max = 0;
for ( row = i; row < n; row++)
if (fabs(Xy[row][i]) > fabs(Xy[max][i]))
max = row;
if (max) {
sign = -sign;
float *tmp = Xy[i];
Xy[i] = Xy[max], Xy[max] = tmp;
}
if (!Xy[i][i]) return 0;
row=0;
for (row = i + 1; row < n; row++) {
float r = Xy[row][i] / Xy[i][i];
if (!r) continue;
for ( col = i; col < n; col ++)
Xy[row][col] -= Xy[i][col] * r;
}
}
return sign;
}
Unfortunately get this error
main.c:74:20: error: wrong type argument to unary minus
the line of the error
sign = -sign;