# HG changeset patch
# User Vincent Delecroix <20100.delecroix at gmail.com>
# Date 1368649658 7200
# Node ID 26751f05d3202b9c2b956c8cadee6cfbd4df57f6
# Parent 837b06a5a0ecf085e1d6848b4ce2ac04808936f9
ticket 7160
Add a doctest to check that comparisons involving I^2 in the symbolic ring
works as expected.
diff git a/sage/symbolic/relation.py b/sage/symbolic/relation.py
a

b


247  247  sage: latex(x^(3/5) >= pi) 
248  248  x^{\frac{3}{5}} \geq \pi 
249  249  
 250  When working with the symbolic complex number `I`, notice that comparison do not 
 251  automatically simplifies even in trivial situations:: 
 252  
 253  sage: I^2 == 1 
 254  1 == 1 
 255  sage: I^2 < 0 
 256  1 < 0 
 257  sage: (I+1)^4 > 0 
 258  4 > 0 
 259  
 260  Nevertheless, if you force the comparison, you get the right answer (trac:`7160`):: 
 261  
 262  sage: bool(I^2 == 1) 
 263  True 
 264  sage: bool(I^2 < 0) 
 265  True 
 266  sage: bool((I+1)^4 > 0) 
 267  False 
250  268  
251  269  More Examples 
252  270   