#11856: Raise an overflow error if the exponent of a multivariate polynomial
flows
over
-----------------------------------+----------------------------------------
Reporter: SimonKing | Owner: malb
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-4.7.2
Component: commutative algebra | Keywords: exponent overflow
Work_issues: | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies:
-----------------------------------+----------------------------------------
Changes (by newvalueoldvalue):
* status: new => needs_review
* author: => Simon King
Comment:
The attached patch seems to solve the problem. It wraps the attribute
`bitmask` of Singular's rings. Moreover, it detects exponent overflow in
the same way as Singular does (see ticket description). `rVar` is in fact
a macro that simply returns the `ring->N` attribute.
With the patch, I get (as a new doctest):
{{{
sage: P.<x,y> = QQ[]
sage: y^2^30
y^1073741824
sage: P.<x,y,z> = QQ[]
sage: y^2^30
Traceback (most recent call last):
...
OverflowError: Exponent overflow (1073741824).
}}}
I did not run the doc tests yet, but I think a reviewer can already have a
look on it.
I wonder, though, whether the speed will be fine: I use the `max` function
with the arguments being an unsigned long and a long. I can only hope that
it is fast enough in Cython.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11856#comment:1>
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.