diff --git a/ext/crates/algebra/src/algebra/milnor_algebra.rs b/ext/crates/algebra/src/algebra/milnor_algebra.rs index cdcaef643..411a9ee01 100644 --- a/ext/crates/algebra/src/algebra/milnor_algebra.rs +++ b/ext/crates/algebra/src/algebra/milnor_algebra.rs @@ -1043,7 +1043,7 @@ impl MilnorAlgebra { // Now put everything together let m = MilnorBasisElement { p_part: new_p, - q_part: term.q_part | 1 << (k + i as u32), + q_part: term.q_part | (1 << (k + i as u32)), degree: 0, // we don't really care about the degree here. The final degree of the whole calculation is known a priori }; let c = if larger_q % 2 == 0 { @@ -1588,7 +1588,7 @@ impl MilnorAlgebra { }); let second_idx = self.basis_element_to_index(&MilnorBasisElement { - q_part: basis.q_part ^ 1 << i, + q_part: basis.q_part ^ (1 << i), p_part: basis.p_part.clone(), degree: second_degree, }); diff --git a/ext/crates/fp/src/field/smallfq.rs b/ext/crates/fp/src/field/smallfq.rs index 4f89f7501..6883a5da6 100644 --- a/ext/crates/fp/src/field/smallfq.rs +++ b/ext/crates/fp/src/field/smallfq.rs @@ -263,7 +263,7 @@ impl FieldInternal for SmallFq

{ /// This is 2n + 1 if `element` is a^n, and 0 otherwise. fn encode(self, element: FieldElement) -> Limb { - element.value.0.map(|x| (x as Limb) << 1 | 1).unwrap_or(0) + element.value.0.map(|x| ((x as Limb) << 1) | 1).unwrap_or(0) } fn decode(self, element: Limb) -> FieldElement {