Skip to content

fix the symbolic csgn function on complex input #9881

@burcin

Description

@burcin

Our wrapper of the csgn function from GiNaC (in sage/symbolic/expression.pyx) doesn't reflect it's real definition:

  /** Return the complex half-plane (left or right) in which the number lies.
   *  csgn(x)==0 for x==0, csgn(x)==1 for Re(x)>0 or Re(x)=0 and Im(x)>0,
   *  csgn(x)==-1 for Re(x)<0 or Re(x)=0 and Im(x)<0.
   *  */

Fix this and add doctests.

We should also consider using GiNaC's csgn() function for the top level sgn() and sign() functions. This should be on a different ticket though.

Component: symbolics

Keywords: pynac

Author: Burcin Erocal

Reviewer: Karl-Dieter Crisman

Merged: sage-4.6.alpha3

Issue created by migration from https://trac.sagemath.org/ticket/9881

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions