Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#232 closed bug (fixed)

Spurious (32bit) overflow in ring exponents on x86_64

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

Description

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
                                                       0<
     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)^65
> x(0)^66;
   ? OVERFLOW
   ? error occurred in or before STDIN line 3: `x(0)^66;`
> x(0)^65 * x(0);
x(0)^66

This is Singular 3.1.1 running on Fedora 12 x86_64.

Change History (2)

comment:1 Changed 14 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 14 years ago by hannes

Comment by Volker Braun:

I also dug around in iparith.cc 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.