This is probably a late comment, but genus() in Singular is also known for containing bugs, see tickets http://www.singular.uni-kl.de:8002/trac/ticket/259, http://www.singular.uni-kl.de:8002/trac/ticket/469
Jack Am Dienstag, 23. November 2010 11:56:20 UTC+1 schrieb Martin Albrecht: > > On Tuesday 23 November 2010, VictorMiller wrote: > > Thanks! Then perhaps Sage should raise an exception when it gets back > > genus -1 from singular. > > Here's what Hannes Schönemann from the Singular team replied to me when I > reported this on [libsingular-devel]: > > """ > Singular uses (currently) 32bit int on all platforms. > Here our overflow detection represents -1 as a result of a subtraction > as 4294967295. > Fix (in Singular/iparith.cc, routine jjMINUS_I): > --- iparith.cc (Revision 13661) > +++ iparith.cc (Arbeitskopie) > @@ -697,14 +697,18 @@ > } > static BOOLEAN jjMINUS_I(leftv res, leftv u, leftv v) > { > - unsigned int a=(unsigned int)(unsigned long)u->Data(); > - unsigned int b=(unsigned int)(unsigned long)v->Data(); > + void *ap=u->Data(); void *bp=v->Data(); > + int aa=(int)(long)ap; > + int bb=(int)(long)bp; > + int cc=aa-bb; > + unsigned int a=(unsigned int)(unsigned long)ap; > + unsigned int b=(unsigned int)(unsigned long)bp; > unsigned int c=a-b; > if (((Sy_bit(31)&a)!=(Sy_bit(31)&b))&&((Sy_bit(31)&a)!=(Sy_bit(31)&c))) > { > WarnS("int overflow(-), result may be wrong"); > } > - res->data = (char *)((long)c); > + res->data = (char *)((long)cc); > return jjPLUSMINUS_Gen(res,u,v); > } > """ > > It seems with the new patch the overflow would at least be detected? Can > you > give it a try? > > Cheers, > Martin > > -- > name: Martin Albrecht > _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99 > _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF > _www: http://martinralbrecht.wordpress.com/ > _jab: martinr...@jabber.ccc.de <javascript:> > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.