Status: Valid
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 4123 by [email protected]: Rational.__lt__ and friends needs to watch for nan
http://code.google.com/p/sympy/issues/detail?id=4123

Mul(x,3,evaluate=False)
3*x
Mul(nan,3,evaluate=False)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sympy\core\basic.py", line 457, in __repr__
    return sstr(self, order=None)
  File "sympy\printing\str.py", line 726, in sstr
    s = p.doprint(expr)
  File "sympy\printing\printer.py", line 233, in doprint
    return self._str(self._print(expr))
  File "sympy\printing\printer.py", line 257, in _print
    return getattr(self, printmethod)(expr, *args, **kwargs)
  File "sympy\printing\str.py", line 262, in _print_Mul
    args = expr.as_ordered_factors()
  File "sympy\core\mul.py", line 1506, in as_ordered_factors
    cpart.sort(key=lambda expr: expr.sort_key(order=order))
  File "sympy\core\numbers.py", line 1659, in __lt__
    return Rational.__lt__(self, other)
  File "sympy\core\numbers.py", line 1341, in __lt__
    return bool(self.p*other.q < self.q*other.p)
AttributeError: 'NaN' object has no attribute 'q'

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to