Ticket #8565: trac_8565-neg_pi.patch

File trac_8565-neg_pi.patch, 1.5 KB (added by burcin, 12 years ago)

add doctests

  • sage/functions/trig.py

    # HG changeset patch
    # User Burcin Erocal <burcin@erocal.org>
    # Date 1270200415 -7200
    # Node ID 86470714b52ad2779bb0188e8d723164c1068382
    # Parent  db7143738e1dbcb0c5415884ebaeee4500da1520
    trac 8565: add doctests for fixes in GiNaC/pynac that allows correctly deducing negativity of mul objects. This also fixes the "divide by zero" error raised by evaluating atan2(-pi,0).
    
    diff --git a/sage/functions/trig.py b/sage/functions/trig.py
    a b  
    536536            sage: x,y = var('x,y')
    537537            sage: arctan2(y,x).operator()
    538538            arctan2
     539
     540        Check if #8565 is fixed::
     541
     542            sage: atan2(-pi,0)
     543            -1/2*pi
    539544        """
    540545        GinacFunction.__init__(self, "arctan2", nargs=2, latex_name=r'\arctan',
    541546                conversions=dict(maxima='atan2'))
  • sage/symbolic/expression.pyx

    diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
    a b  
    12761276            sage: SR(-5)._is_negative()
    12771277            True
    12781278
    1279         We can't deduce much for _is_negative()::
     1279        Check if we can correctly deduce negativity of mul objects::
    12801280
    12811281            sage: t0 = SR.symbol("t0", domain='positive')
    12821282            sage: t0._is_negative()
    12831283            False
    12841284            sage: (-t0)._is_negative()
    1285             False
     1285            True
     1286            sage: (-pi)._is_negative()
     1287            True
    12861288        """
    12871289        return self._gobj.info(info_negative)
    12881290