[sage-support] Re: testing for equality

2008-09-02 Thread John Cremona
2008/9/2 Jason Merrill <[EMAIL PROTECTED]>: > > Be careful with bool. It will return False for equations that may be > true. Simple example: > > sage: bool(x == 0) > False > > I believe in some cases it will return False for equations that are > actually True if sage doesn't know how to make the

[sage-support] Re: testing for equality

2008-09-02 Thread Jason Merrill
Be careful with bool. It will return False for equations that may be true. Simple example: sage: bool(x == 0) False I believe in some cases it will return False for equations that are actually True if sage doesn't know how to make the necessary simplifications. But if it returns True, you can

[sage-support] Re: testing for equality

2008-09-02 Thread John H Palmieri
On Sep 2, 8:19 am, "John Cremona" <[EMAIL PROTECTED]> wrote: > Putting == between two symbol expressions creates a symbolic equation, > not a test for equality.  There is there fore a difference between > these: > > sage: 3 == 3 > True > sage: x == x > x == x In the same category as the latter:

[sage-support] Re: testing for equality

2008-09-02 Thread John Cremona
Putting == between two symbol expressions creates a symbolic equation, not a test for equality. There is there fore a difference between these: sage: 3 == 3 True sage: x == x x == x This behaviour of == is (I think) unique to the symbolic ring in Sage. You can test for equality like this: sag