Ticket #9881: trac_9881-csgn.patch

File trac_9881-csgn.patch, 1.3 KB (added by burcin, 11 years ago)
  • sage/symbolic/expression.pyx

    # HG changeset patch
    # User Burcin Erocal <burcin@erocal.org>
    # Date 1284023759 -7200
    # Node ID de37d995a17c6ac9a4d1978c29b1789e0a9387a2
    # Parent  6384a472bba2027c020cffbff63f32f3d872ed84
    #9881: add doctests to the csgn() method of symbolic expressions to demonstrate behavior on complex input.
    
    diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
    a b  
    46584658        0, and 1 if self > 0, or unevaluated when self is a nonconstant
    46594659        symbolic expression.
    46604660
    4661         It can be somewhat arbitrary when self is not real.
    4662        
    4663         EXAMPLES:
     4661        If self is not real, return the complex half-plane (left or right)
     4662        in which the number lies.
     4663
     4664        EXAMPLES::
     4665
    46644666            sage: x = var('x')
    46654667            sage: SR(-2).csgn()
    46664668            -1
     
    56175619            1
    56185620            sage: SR(0).binomial(0)
    56195621            1
     5622            sage: SR(-I).csgn()
     5623            -1
     5624            sage: SR(1+I).csgn()
     5625            1
     5626            sage: SR(1-I).csgn()
     5627            1
     5628            sage: SR(-1+I).csgn()
     5629            -1
     5630            sage: SR(-1-I).csgn()
     5631            -1
    56205632        """
    56215633        cdef Expression nexp = self.coerce_in(k)
    56225634        _sig_on