Ticket #9881 (closed defect: fixed)
fix the symbolic csgn function on complex input
| Reported by: | burcin | Owned by: | burcin |
|---|---|---|---|
| Priority: | major | Milestone: | sage-4.6 |
| Component: | symbolics | Keywords: | pynac |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | Karl-Dieter Crisman |
| Authors: | Burcin Erocal | Merged in: | sage-4.6.alpha3 |
| Dependencies: | Stopgaps: |
Description
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.
Attachments
Change History
comment:1 follow-up: ↓ 2 Changed 3 years ago by burcin
- Status changed from new to needs_review
- Authors set to Burcin Erocal
The new pynac package at #9201 changes the csgn() function according to the description. attachment:trac_9881-csgn.patch adds doctests for the new specification.
The pynac package includes patches for #9394, #9834, #9878, #9879, #9900 as well as this ticket. See the ticket description of #9901 for the list (and order) of patches associated to the new version.
comment:3 Changed 3 years ago by kcrisman
- Reviewers set to Karl-Dieter Crisman
Just FYI - this appears to still apply cleanly after the review patch at #9879.
comment:4 Changed 3 years ago by kcrisman
- Status changed from needs_review to positive_review
Okay, this looks good on both Pynac and Sage side - with the exception that I think the documentation needed slightly more clarity, and that some of the examples got misplaced to binomial for some reason. Positive review; apply reviewer patch after initial patch.
Changed 3 years ago by kcrisman
-
attachment
trac_9881-csgn-reviewer.patch
added
Apply after initial patch.
