Ticket #7160: trac_7160-doctest.take2.patch

File trac_7160-doctest.take2.patch, 988 bytes (added by burcin, 8 years ago)

fix commit message, and sphinx trac link

  • sage/symbolic/relation.py

    # HG changeset patch
    # User Vincent Delecroix <20100.delecroix at gmail.com>
    # Date 1368649658 -7200
    # Node ID 763f0b56a41de4e048e7e761ba4201990d171873
    # Parent  ffcf409b74fe9b763e5b0ec7348b079adef75ec4
    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  
    247247    sage: latex(x^(3/5) >= pi)
    248248    x^{\frac{3}{5}} \geq \pi
    249249
     250When working with the symbolic complex number `I`, notice that comparison do not
     251automatically 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
     260Nevertheless, 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
    250268
    251269More Examples
    252270-------------