On Thu, Sep 18, 2008 at 12:12 PM, John H Palmieri <[EMAIL PROTECTED]> wrote: > > > > On Sep 18, 9:51 am, "William Stein" <[EMAIL PROTECTED]> wrote: >> On Thu, Sep 18, 2008 at 9:49 AM, John Cremona <[EMAIL PROTECTED]> wrote: >> >> > This looks a bit like an additive version of what we already do with >> > factorizations. I wonder if you could clever use the factorization >> > class for it? >> >> It's possible somebody might find this useful: >> >> sage: FormalSum([(1,1/4),(1,-1/5)]) >> -1/5 + 1/4 > > It might be useful, except for this: > > sage: FormalSum([(1,1/4),(1,-1/5)]) > -1/5 + 1/4 > sage: FormalSum([(1,1/4),(1,-1/5)]) == 1/4 - 1/5 > False >
That could be considered a bug and fixed. I would be fine with something better, i.e., comparison computing the value of the formal sum if possible, and comparing them. William > I think that if you do > > sage: (1/20).partial_fraction_decomposition() > > then it makes the most sense if the return value is == to 1/20. That's > why I was thinking of using a new class with _repr_ and _latex_ > methods for printing the decomposition. > > > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---