Ticket #10767: 10767_doctest.patch

File 10767_doctest.patch, 1013 bytes (added by jdemeyer, 8 years ago)
  • sage/rings/number_field/number_field_ideal.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1304079713 -7200
    # Node ID cf76a285591c250f1f01804ad6fb215fe868790f
    # Parent  c01d02584aa945e49c0c372395abf0fcb5cc52e1
    Add doctest to ensure that PARI bug 1192 (fractional ideal intersections) is fixed
    
    diff -r c01d02584aa9 -r cf76a285591c sage/rings/number_field/number_field_ideal.py
    a b  
    907907            sage: B = L.ideal([6, (-1/2*b + 1)*a - b - 5/2])
    908908            sage: A.intersection(B) == L.ideal(-1/2*a - 3/2*b - 1)
    909909            True
     910
     911        TESTS:
     912
     913        Test that this works with non-integral ideals (#10767)::
     914
     915            sage: K = QuadraticField(-2)
     916            sage: I = K.ideal(1/2)
     917            sage: I.intersection(I)
     918            Fractional ideal (1/2)
    910919        """
    911920        L = self.number_field()
    912921        other = L.ideal(other)