Ticket #11513: trac_11513-is_numerically_zero.patch

File trac_11513-is_numerically_zero.patch, 1.0 KB (added by burcin, 10 years ago)

temporary patch

  • sage/symbolic/expression.pyx

    # HG changeset patch
    # User Burcin Erocal <burcin@erocal.org>
    # Date 1308269201 -7200
    # Node ID 3037dca14a11c235c48894b600bdb620b1968bac
    # Parent  d668124d013b6862f2b40c1c12061f96e0817712
    [mq]: trac_11513-is_numerically_zero.patch
    
    diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
    a b  
    15721572
    15731573    rhs = right = right_hand_side
    15741574
     1575    def _is_numerically_zero(self):
     1576        """
     1577        Provides a fast way to check if this expression is zero.
     1578
     1579        EXAMPLES::
     1580
     1581            sage: x._is_numerically_zero()
     1582            False
     1583            sage: SR(0)._is_numerically_zero()
     1584            True
     1585        """
     1586        #from sage.rings.all import CIF
     1587        #cdef GEx res
     1588        #res = self._gobj.evalf(0, CIF)
     1589        if not is_a_numeric(self._gobj):
     1590            return False
     1591        return self._gobj.is_zero()
     1592
    15751593    def __nonzero__(self):
    15761594        """
    15771595        Return True unless this symbolic expression can be shown by Sage