#12179: Binomial of integer (mod n) returns integer
--------------------------------+-------------------------------------------
Reporter: scotts | Owner: AlexGhitza
Type: defect | Status: new
Priority: major | Milestone: sage-4.8
Component: basic arithmetic | Keywords: binomial coefficiant, modulo
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
--------------------------------+-------------------------------------------
{{{
sage: R = Integers(6)
sage: binomial(R(5), R(2))
10
sage: binomial(R(5), R(2)).parent()
Integer Ring
}}}
Wouldn't we expect the answer to be 4 and an element of R?
The offending code is in the method binomial of
[http://trac.sagemath.org/sage_trac/browser/sage/rings/arith.py
rings/arith.py]
The problem is that the code will immediately attempt to deal with the
inputs as integers by x=ZZ(x) and makes no attempt to convert them back
into the original ring.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12179>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.