Ticket #383: 383-fixes.patch

File 383-fixes.patch, 2.4 KB (added by robertwb, 11 years ago)
  • sage/rings/fraction_field_element.pyx

    diff -r 77c0a081eb72 -r bbd14bd2b542 sage/rings/fraction_field_element.pyx
    a b  
    440440       
    441441        TESTS::
    442442       
     443            sage: R = RR['x']     # Inexact, so no reduction.
     444            sage: F = Frac(R)
    443445            sage: from sage.rings.fraction_field_element import FractionFieldElement
    444446            sage: z = FractionFieldElement(F, 0, R.gen(), coerce=False)
    445447            sage: z.numerator() == 0
  • sage/rings/polynomial/polynomial_integer_dense_flint.pyx

    diff -r 77c0a081eb72 -r bbd14bd2b542 sage/rings/polynomial/polynomial_integer_dense_flint.pyx
    a b  
    513513            sage: parent(f.quo_rem(g)[0])
    514514            Univariate Polynomial Ring in x over Rational Field
    515515            sage: f.quo_rem(3)
     516            (0, x + 1)
    516517            sage: (5*x+7).quo_rem(3)
    517518            (x + 2, 2*x + 1)
    518519        """
  • sage/rings/polynomial/polynomial_zmod_flint.pyx

    diff -r 77c0a081eb72 -r bbd14bd2b542 sage/rings/polynomial/polynomial_zmod_flint.pyx
    a b  
    575575            ValueError: leading coefficient must be invertible
    576576        """
    577577        if self.base_ring().characteristic().gcd(\
    578                 self.leading_coefficient()) != 1:
     578                self.leading_coefficient().lift()) != 1:
    579579            raise ValueError, "leading coefficient must be invertible"
    580580        cdef Polynomial_zmod_flint res = self._new()
    581581        zmod_poly_make_monic(&res.x, &self.x)
  • sage/rings/residue_field.pyx

    diff -r 77c0a081eb72 -r bbd14bd2b542 sage/rings/residue_field.pyx
    a b  
    557557                raise ZeroDivisionError, "Cannot reduce rational %s modulo %s: it has negative valuation"%(x,p)
    558558
    559559        dx = x.denominator()
    560         if x.is_integral() or dx.gcd(p.absolute_norm()) == 1:
     560        if x.is_integral() or dx.gcd(ZZ(p.absolute_norm())) == 1:
    561561            return self.__F(self.__to_vs(x) * self.__PBinv)
    562562
    563563        # Now we do have to work harder...below this point we handle