Closed vascoosx closed 9 years ago
really interesting, thanks for looking into this. a couple questions:
int
:#define SGN(x, y, z) (x < y ? 0 : z)
...
*lp++ =
SGN(v[0], v[1], 2) + SGN(v[0], v[2], 4) +
SGN(v[0], v[3], 8) + SGN(v[0], v[4], 16) +
SGN(v[0], v[5], 32) + SGN(v[0], v[6], 64) +
SGN(v[0], v[7], 128) + SGN(v[0], v[8], 256) ;
(SGN(v[0],v[1],2)) + (SGN(v[0],v[2],4)) +
(SGN(v[0],v[3],8)) + (SGN(v[0],v[4],16)) +
(SGN(v[0],v[5],32)) + (SGN(v[0],v[6],64)) +
(SGN(v[0],v[7],128)) + (SGN(v[0],v[8],256));
thanks! after you posted that i realized i just needed to put parentheses around the SGN
macro definition to avoid the error.
In order to sum the result of the macro "SGN" (ex. SGN(1)* 2 + SGN(-1)*3) casting to int was required