def ops_with_nan(self, p): nan = RatPoly.from_str("nan") assert_eq_str(p + nan, "nan") assert_eq_str(nan + p, "nan") assert_eq_str(p - nan, "nan") assert_eq_str(nan - p, "nan") assert_eq_str(p * nan, "nan") assert_eq_str(nan * p, "nan") assert_eq_str(p / nan, "nan") assert_eq_str(nan / p, "nan")
def parse(s): return RatPoly.from_str(s)