Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#414 closed bug (fixed)

Overflow in echoing large numbers from coefficient rings

Reported by: dreyer Owned by: hannes
Priority: major Milestone: 3-1-5 and higher
Component: dontKnow Version: 3-1-4
Keywords: Cc: olmarx@…, dreyer

Description (last modified by dreyer)

Hi! Large numbers from Z/2n are not printed correctly:

dreyer@lts035:x86_64-Linux> ./Singular
                     SINGULAR                                 /
 A Computer Algebra System for Polynomial Computations       /   version 3-1-4
                                                           0<
 by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann     \   Jan 2012
FB Mathematik der Universitaet, D-67653 Kaiserslautern        \
> ring r=(integer,2,33),(dummy),lp;
> number num=number(2)^32;num;
0
> num/2;
-2147483648
> number(2)^31;
-2147483648

We can see from the last two commands that number stores the information (here 2^32) correctly. Just the output goes wrong (overflow?),

Change History (6)

comment:1 Changed 12 years ago by dreyer

Description: modified (diff)

comment:2 Changed 12 years ago by dreyer

Even worse: Singular forgets "+" between terms in some case:

> ring r = (integer, 2, 49), (var_1, var_10), lp;
> poly p = 131072*(-536870912 * var_1  -1073741824 * var_10);
> p;
0*var_10*var_10

So the output pretends that var_10}} exists twice. Note that Singular 3-1-0 (Mar 2009) prints {{{-0*var_1-0*var_10 in this case. (But it already had problems with the output of large numbers).

comment:3 Changed 12 years ago by barakat

Owner: changed from somebody to hans

comment:4 Changed 12 years ago by barakat

Owner: changed from hans to hannes

comment:5 Changed 12 years ago by hannes

Resolution: fixed
Status: newclosed

output routine is fixed, I hope that this but is only an output problem

comment:6 Changed 12 years ago by dreyer

Cc: dreyer added

I can confirm that the fix also works for the real-world example, that motivated the ticket originally.

Note: See TracTickets for help on using tickets.