Opened 9 years ago

Closed 8 years ago

# detect exponent overflows for polynomial operations

Reported by: Owned by: kroeker@… somebody minor 4-1-0 and higher dontKnow 4-0-0 overflow polynomial operations

### Description

overflow hell:

``` ring rng = 0,(x,y),dp;
> short = 0 ;
>
. poly f = x^1073741823;
> subst(f,x,x^3); // ** undetected overflow **
x^3221225469*y^4294967295
>
. f = x^2147483647;
> poly g = f*f;
>
. g*x*x;  // ok
? OVERFLOW in mult(d=4294967295, d=1, max=4294967295)
? error occurred in or before STDIN line 12: `g*x*x;  // ok`
>
. ideal J = g*x;
> J*x; // ** undetected overflow **
_=y
> J*J; // ** undetected overflow **
_=x^4294967294*y
>
.  poly h = x^2147483647;
>
.  h = h*x;
> ideal I = h;
> subst(I,x,x^2); // ok
// ** possible OVERFLOW in subst, max exponent is 4294967295
_=1
>
. ring G = 0,(a,b),dp;
> ideal phi = a,b;
> map m = rng,a^2,b;
> m(I); // ** undetected overflow **
_=1
```

input:

```ring rng = 0,(x,y),dp;

poly f = x^1073741823;
subst(f,x,x^3);

f = x^2147483647;
poly g = f*f;

g*x*x;  // ok

ideal J = g*x;
J*x;
J*J;

poly h = x^2147483647;

h = h*x;
ideal I = h;
subst(I,x,x^2); // ok

ring G = 0,(a,b),dp;
ideal phi = a,b;
map m = rng,a^2,b;
m(I);

```

Question: are other overflow issues known? May the same happen in 'factory'?

### comment:1 Changed 8 years ago by hannes

Resolution: → fixed new → closed

partially duplicate to tr. #696, fix and test there.

Comments: factory is not involved: no degree-increasing routines of factory can be reached

Note: See TracTickets for help on using tickets.