Ticket #9051: trac_9051_polycall_fixes.patch

File trac_9051_polycall_fixes.patch, 1.6 KB (added by roed, 11 years ago)

Fixes the broken doctests

  • sage/rings/polynomial/polynomial_element.pyx

    # HG changeset patch
    # User David Roe <roed@math.harvard.edu>
    # Date 1278676703 14400
    # Node ID d7c6c7793df8a84ebd363ecccf02afadcff83103
    # Parent  45caba96bd9c98c54f2d150ded80afb654c1b591
    [mq]: trac_9051_polycall_fixes.patch
    
    diff -r 45caba96bd9c -r d7c6c7793df8 sage/rings/polynomial/polynomial_element.pyx
    a b  
    510510            sage: f = ZZ['x'](1000000 * [1])
    511511            sage: f(1)
    512512            1000000
     513
     514        The following test came up in 9051::
     515
     516            sage: Cif = ComplexIntervalField(64)
     517            sage: R.<x> = Cif[]
     518            sage: f = 2*x-1
     519            sage: jj = Cif(RIF(0,2))
     520            sage: f(jj).center(), f(jj).diameter()
     521            (1.00000000000000000, 4.00000000000000000)
    513522           
    514523        AUTHORS:       
    515524       
     
    588597            except AttributeError:
    589598                return result
    590599
    591         if a == self._parent.gen():
     600        if parent(a) is self._parent and a.is_gen():
    592601            return self
    593602        elif is_FractionField(parent(a)):
    594603            try:
     
    604613            while i >= 0:
    605614                result = result * a + self[i](other_args)
    606615                i -= 1
    607         elif not a:
     616        elif not a and a.parent().is_exact(): #without the exactness test we can run into trouble with interval fields.
    608617            c = self[0]
    609618            return c + c*a
    610619        elif (d < 4 or d > 50000) and self._compiled is None: