Updates:
        Cc: fredrik.johansson

Comment #3 on issue 2107 by asmeurer: Real(0.1, 10) - Real(0.1, 10) -> 3.637923296e-13
http://code.google.com/p/sympy/issues/detail?id=2107

The only thing that I can see that is being called differently there is that Real has __add__ defined but not __sub__ (this just defaults to Expr.__sub__(), which calls Add(self, -other)). The code for Real.__add__() is


    @_sympifyit('other', NotImplemented)
    def __add__(self, other):
        if (other is S.NaN) or (self is NaN):
            return S.NaN
        if isinstance(other, Number):
            rhs, prec = other._as_mpf_op(self._prec)
            return Real._new(mlib.mpf_add(self._mpf_, rhs, prec, rnd), prec)
        return Number.__add__(self, other)

So the solution is just to add a similar Real.__sub__()?

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to