Hi,
I have some problems with the way is_zero() is implemented (or maybe
it is the documentation...)
Is this behavior really desirable?

sage: k = var('k')
sage: pol = 1/(k-1) - 1/k -1/k/(k-1)
sage: pol
-1/((k - 1)*k) - (1/k) + 1/(k - 1)
sage: pol.partial_fraction()
0
sage: pol.is_zero()
False
sage: pol.is_zero??
Type:           builtin_function_or_method
Base Class:     <type 'builtin_function_or_method'>
String Form:    <built-in method is_zero of SymbolicArithmetic object
at 0xc4b6af8>
Namespace:      Interactive
Source:
    def is_zero(self):
        """
        Return True if self equals self.parent()(0). The default
        implementation is to fall back to 'not self.__nonzero__'.

        NOTE: Do not re-implement this method in your subclass but
        implement __nonzero__ instead.
        """
        return not self
sage: pol == pol.parent()(0)
-1/((k - 1)*k) - (1/k) + 1/(k - 1) == 0

Paul


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to