#17123: Extending binomial(n,k) to negative integers n, k.
---------------------------------+------------------------
Reporter: pluschny | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone: sage-6.4
Component: combinatorics | Resolution:
Keywords: binomial | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
---------------------------------+------------------------
Comment (by SimonKing):
Replying to [comment:3 pluschny]:
> Volker, what is the reason for your sarcasm?
It could be that he thinks that fixing the problem is a matter of not more
than 30 minutes. But if I understand correctly you have no experience with
Sage development, yet. And I think Volker should take this into account.
> Simon, certainly. But only in this form I could test it against the
implemented version without running into a recursion.
The implemented version just raises an error on negative input. Instead of
raising the error, the binomial function should simply modify the given
negative arguments according to the formula that you present in the ticket
description.
Then, the documentation of the binomial function should be modified to
contain a description and a test for the new behaviour. And to be on the
safe side, the test suite should be run.
When working on a ticket, one ought to create a git branch for the ticket.
The documentation will tell you how. For example, if you have the git trac
scripts installed, you can do `git trac checkout 17123` on the
commandline.
How to edit the binomial function?
First way: Find out in what module the function is defined.
{{{
sage: binomial.__module__
'sage.functions.other'
}}}
Hence, take your favourite editor and edit
`SAGE_ROOT/src/sage/functions/other.py
Second way: In a running Sage session, do
{{{
sage: edit(binomial, 'vim')
}}}
where vim is your favourite editor. It will open the correct file in the
correct line (if not, report a bug!).
After saving the change, leave Sage and do `make` (which will also build
the changes in the documentation) or better `make test` in order to also
run the test suite of Sage.
If everything works, commit your changes (`git commit -a`) and push them
to this ticket (with the git trac scripts, this is `git trac push`).
--
Ticket URL: <http://trac.sagemath.org/ticket/17123#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.