use crate::natural::Natural;
use crate::natural_polynomial::NaturalPolynomial;
use malachite_base::num::basic::unsigneds::PrimitiveUnsigned;
use malachite_base::unsigned_polynomial::UnsignedPolynomial;
impl<T: PrimitiveUnsigned> PartialEq<UnsignedPolynomial<T>> for NaturalPolynomial
where
Natural: PartialEq<T>,
{
fn eq(&self, other: &UnsignedPolynomial<T>) -> bool {
let other = other.coefficients_asc();
self.coefficients.len() == other.len()
&& self.coefficients.iter().zip(other).all(|(x, y)| x == y)
}
}
impl<T: PrimitiveUnsigned> PartialEq<NaturalPolynomial> for UnsignedPolynomial<T>
where
Natural: PartialEq<T>,
{
#[inline]
fn eq(&self, other: &NaturalPolynomial) -> bool {
other == self
}
}