#15746: Polynomials over finite fields gives overflow error with large numbers
----------------------------------------------+------------------------
Reporter: tscrim | Owner: tscrim
Type: defect | Status: new
Priority: major | Milestone: sage-6.1
Component: coercion | Resolution:
Keywords: polynomials, finite fields | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
----------------------------------------------+------------------------
Changes (by pbruin):
* component: basic arithmetic => coercion
Comment:
Part of what is going on here is that Singular works with 32-bit integers;
compare
{{{
$ ./sage -singular
SINGULAR /
Development
A Computer Algebra System for Polynomial Computations / version
3-1-5
0<
by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann \ Jul 2012
FB Mathematik der Universitaet, D-67653 Kaiserslautern \
> 2^31;
// ** int overflow(^), result may be wrong
-2147483648
}}}
The particular error in the ticket description would be fixed by letting
the coercion (of the integer into the polynomial ring) go via the base
field. Actually, the coercion map itself suggests that this should
already happen:
{{{
sage: f = R.coerce_map_from(ZZ); f
Composite map:
From: Integer Ring
To: Multivariate Polynomial Ring in x, y over Finite Field of size 7
Defn: Natural morphism:
From: Integer Ring
To: Finite Field of size 7
then
Polynomial base injection morphism:
From: Finite Field of size 7
To: Multivariate Polynomial Ring in x, y over Finite Field of
size 7
sage: f(2^31)
2
}}}
So the real problem here is that `R(2^31)` does not call `f` as it ought
to (I think).
--
Ticket URL: <http://trac.sagemath.org/ticket/15746#comment:2>
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/groups/opt_out.