replace bitwise with Boolean operators

This commit is contained in:
Andreas Fabri 2013-03-11 19:50:31 +01:00
parent 0fb7b0d390
commit d4c53f845d
1 changed files with 2 additions and 2 deletions

View File

@ -596,8 +596,8 @@ polynomial_subresultant_matrix(typename Polynomial_traits_d::Polynomial_d f,
// Divide through the divisor and set the correct sign
for(int i=0;i<m;i++) {
for(int j = i;j<m;j++) {
bool negate = ((n-m+i+1) & 2)>>1; // (n-m+i+1)==2 or 3 mod 4
negate=negate ^ (swapped & ((n-m+i+1)*(i+1)));
bool negate = (((n-m+i+1) & 2)>>1) != 0; // (n-m+i+1)==2 or 3 mod 4
negate = negate != (swapped && (((n-m+i+1)*(i+1)) != 0));
//...XOR (swapped AND (n-m+i+1)* (i+1) is odd)
Ret[i][j] = idiv(Ret[i][j], negate ? -divisor : divisor);
}