Ticket #5710: trac_5710.patch

File trac_5710.patch, 1.4 KB (added by was, 12 years ago)
  • sage/rings/number_field/number_field_element.pyx

    # HG changeset patch
    # User wstein@gmail.com
    # Date 1239159348 14400
    # Node ID 3c759c34329f8973fc5532516d5656404a52025d
    # Parent  3775545bbccf16d39d89ee809f26d4b163fae269
    trac #5710 -- solaris -- fix "is monic" issue with NTL in number_field_element.pyx
    
    diff -r 3775545bbccf -r 3c759c34329f sage/rings/number_field/number_field_element.pyx
    a b  
    893893        _sig_on
    894894        # MulMod doesn't handle non-monic polynomials.
    895895        # Therefore, we handle the non-monic case entirely separately.
    896         if ZZX_is_monic( &self.__fld_numerator.x ):
     896
     897        if ZZ_IsOne(ZZX_LeadCoeff(self.__fld_numerator.x)):
    897898            ZZ_mul(x.__denominator, self.__denominator, _right.__denominator)
    898899            ZZX_MulMod(x.__numerator, self.__numerator, _right.__numerator, self.__fld_numerator.x)
    899900        else:
     
    951952        x = self._new()
    952953        _sig_on
    953954        _right._invert_c_(&inv_num, &inv_den)
    954         if ZZX_is_monic( &self.__fld_numerator.x ):
     955        if ZZ_IsOne(ZZX_LeadCoeff(self.__fld_numerator.x)):
    955956            ZZ_mul(x.__denominator, self.__denominator, inv_den)
    956957            ZZX_MulMod(x.__numerator, self.__numerator, inv_num, self.__fld_numerator.x)
    957958        else: