Updates:
Cc: ondrej.certik
Labels: NeedsReview
Comment #1 on issue 1634 by smichr: Cannot compare NumberSymbols like pi
and E
http://code.google.com/p/sympy/issues/detail?id=1634
pi<0 is recognized as a number comparison and goes to lt of numbers.py
-pi is an expression and calls up the basic.py lt routine.
The attached patch makes the basic relational operators return a True or
False if the
sign of the quantities involved can be determined. Tests are included.
###
>>> from sympy import *
>>> pi<3
False
>>> -pi<0
True
>>> var('x')
x
>>> x<0
x < 0
>>> x-2<x-3
False
###
All tests pass; all modified code covered.
/c
Attachments:
0001-basic-relationals-changes-so-pi-0-is-True.patch 2.2 KB
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---