#5415: problems with multifactorial?
-------------------------------------+-------------------------------------
Reporter: cwitty | Owner:
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.10
Component: basic arithmetic | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/prateek.cs14/problems_with_multifactorial_|
173f0eaf83f3f894bcbd98b381f891c668da2030
Dependencies: | Stopgaps: todo
-------------------------------------+-------------------------------------
Comment (by nbruin):
Some people have complained about using "self" in the docstring, and they
have a point: in the call
`10.multifactorial(3)` there is never any mention of "self". I think it
can be avoided here. Your description in words is pretty good, but
requires careful reading to pry out the base cases. That might be
difficult for non-native speakers. Perhaps
{{{
Returns the k-th multifactorial.
The k-th multifactorial n, denoted by n!^{(k)}, as implemented in Sage
is defined by
n!^{(k)} = n for 1 <= n < k and
n!^{(k)} = n * ( (n-k)^{(k)} for n >= k
The recursive definition is used to extend this function to the negative
integers.
}}}
You'd have to figure out how to ensure that the formulas are rendered
acceptably in all output formats of the sage documentation, though.
That said, your proposal is in the style of the current docstring, so I
don't think a positive review would be held back by it.
Note that one of the doctests illustrates the behaviour:
{{{
sage: 23.multifactorial(2)
316234143225
sage: prod([1..23, step=2])
316234143225
}}}
It would be very instructive if you would change the parameters there to a
case that distinguishes between the old and the new behaviour.
--
Ticket URL: <http://trac.sagemath.org/ticket/5415#comment:30>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.