Ticket #6046: heights2.patch

File heights2.patch, 1.4 KB (added by cremona, 12 years ago)

Apply after previous patch

  • sage/rings/number_field/number_field_element.pyx

    # HG changeset patch
    # User John Cremona <john.cremona@gmail.com>
    # Date 1242405799 -3600
    # Node ID 2aebf0e9f6551f88ab4452941014c589aea16673
    # Parent  8d7f66a806fb85729d404e19b0cf0c8ee454edea
    heights fix
    
    diff -r 8d7f66a806fb -r 2aebf0e9f655 sage/rings/number_field/number_field_element.pyx
    a b  
    698698            return R.zero_element()
    699699        val = self.valuation(P)
    700700        nP = P.residue_class_degree()*P.absolute_ramification_index()
    701         return R(P.norm()) ** (-val // nP)
     701        return R(P.norm()) ** (-R(val) / R(nP))
    702702
    703703    def coordinates_in_terms_of_powers(self):
    704704        r"""
     
    22202220            sage: K.<a> = NumberField(x^4+3*x^2-17)
    22212221            sage: b = a/2
    22222222            sage: b.global_height_arch()
    2223             0.386534073792774
     2223            0.38653407379277...
    22242224        """
    22252225        from sage.rings.real_mpfr import RealField
    22262226        if prec is None:
     
    22592259            sage: K.<a> = NumberField(x^4+3*x^2-17)
    22602260            sage: b = a/2
    22612261            sage: b.global_height()
    2262             2.86922224068797
     2262            2.869222240687...
    22632263            sage: b.global_height(prec=200)
    22642264            2.8692222406879748488543678846959454765968722137813736080066
    22652265