On Wednesday 10 September 2008, John Cremona wrote: > 2008/9/10 Martin Albrecht <[EMAIL PROTECTED]>: > > On Wednesday 10 September 2008, John Cremona wrote: > >> 2008/9/10 Nick Alexander <[EMAIL PROTECTED]>: > >> > On 10-Sep-08, at 1:49 AM, Martin Albrecht wrote: > >> >> On Wednesday 10 September 2008, mabshoff wrote: > >> >>> This is double plus not good. > >> >>> > >> >>> {{{ > >> >>> sage: GF(109)['x', 'y'](-10) > >> >>> -10 > >> >>> sage: GF(109)['x'](-10) > >> >>> 99 > >> >>> > >> >>> }}} > >> >> > >> >> I don't see the problem, since -10 == 99 mod GF(109).Even if it is > >> >> undesired > >> >> that they print differently how come it is 'major'? > >> > > >> > Okay, maybe it is not major. For internal reasons, I am very > >> > unsettled to get back different representations for the same thing. > >> > Try: > >> > > >> > {{{ > >> > sage: GF(109)['x', 'y'](-10) > >> > -10 > >> > sage: GF(109)['x', 'y'](-10).constant_coefficient() > >> > 99 > >> > }}} > >> > > >> > I can't see how this won't bite someone in the ass sometime. > >> > >> Maybe. As far as I can see the _repr_() function on the (constant) > >> poly just gets a string from singular, so is relying on singular's > >> representation for integers mod 109. While the constant_coefficient() > >> function is returning a Sage object. There does not seem to be a > >> method for turning the singular form into a Sage polynomial. > > > > Of course, I *could* write our own _repr_ function instead of just using > > whatever Singular returns back. > > Wouldn't it be better to write a conversion from singular to a Sage > type? Or would that be impossibly complicated (I have no idea how > many Singular types there are, but all we need is a conversion from > MPolynomial_libsingular to start with).
I don't understand, MPolynomial_libsingular (libsingular + wrapper) is the Sage type, just like GMP integers + wrapper is the Sage type. Cheers, Martin -- name: Martin Albrecht _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99 _www: http://www.informatik.uni-bremen.de/~malb _jab: [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---