On Sep 18, 1:01 am, "John Cremona" <[EMAIL PROTECTED]> wrote: > 2008/9/18 John H Palmieri <[EMAIL PROTECTED]>: > > > On Sep 17, 9:09 pm, "William Stein" <[EMAIL PROTECTED]> wrote: > >> On Wed, Sep 17, 2008 at 8:59 PM, John H Palmieri <[EMAIL PROTECTED]> wrote: > > >> > Along the same lines, partial fraction decomposition should work for > >> > rational numbers; this would work if elements of QQ were instances of > >> > FractionFieldElement, right? > > >> Or you could just implement it, which would likely be a good idea. > > > It might be a good idea, but I don't know how to do it. How do I > > produce, given 1/20, the output 1/4 - 1/5? That is, how do I tell > > sage to output 1/4 - 1/5, as an element in QQ, I suppose, without > > evaluating it and just printing 1/20? > > I used to set this as an exercise in my undergaduate number theory > class. Shall I look for my model solution ? ;)
It wasn't the mathematics I was looking for, but how to output the answer once I find it. If Sage computes that 1/20 = 1/4 - 1/5, how do I get it to print the expression 1/4 - 1/5 without simplifying it to 1/20? For example, if I compute the various parts and store them in a list 'parts', then something naive like 'return sum(parts)' won't work. How do I return an expression made up of rational numbers, +'s, and -'s, with no simplification? --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@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-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---