Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#232 closed bug (fixed)

Spurious (32bit) overflow in ring exponents on x86_64

Reported by: Volker Braun <…> Owned by: hannes
Priority: minor Milestone: 3-1-2 and higher
Component: singular-kernel Version: 3-1-1
Keywords: Cc:


I get the following overflow error when constructing monomials. It seems to come from the 2^16=65536 limit when trying to multiply 32-bit integers. But I'm running x64_64 and, from a cursory glance at the source code, think that Singular should use int64 arithmetic here. In any case, as the last example shows exponent degrees over 65536 are handled perfectly fine.

                     SINGULAR                             /
 A Computer Algebra System for Polynomial Computations   /   version 3-1-1
     by: G.-M. Greuel, G. Pfister, H. Schoenemann        \   Feb 2010
FB Mathematik der Universitaet, D-67653 Kaiserslautern    \
> ring r = 0,(x(0..6)),wp(1000,1000,1000,1000,1000,1000,1000);
> x(0)^65;
> x(0)^66;
   ? error occurred in or before STDIN line 3: `x(0)^66;`
> x(0)^65 * x(0);

This is Singular 3.1.1 running on Fedora 12 x86_64.

Change History (2)

comment:1 Changed 13 years ago by hannes

Resolution: fixed
Status: newclosed

max. value is 65536. Changed the test to compare the total degree, not the weighted degree.

comment:2 Changed 13 years ago by hannes

Comment by Volker Braun:

I also dug around in and noticed that this bug was caused by the overflow test in jjPOWER_P(). I agree that testing the un-weighted degree is correct. The same (incorrect) test is also in jjTIMES_P(), but there it is commented out by an #if 0 clause. I think it would be good to fix the overflow test there as well.

Note: See TracTickets for help on using tickets.