In [14]: sympy.nsimplify(a**2.0/a, rational=True) Out[14]: a
seems to work On Jan 10, 2:27 pm, "[email protected]" <[email protected]> wrote: > On the other hand I don't know why a**2.0/a is not a**1.0. This seems like > a bug... > > On 10 January 2012 21:25, [email protected] < > > > > [email protected]> wrote: > > Use nsimplify: > > > In [2]: a**2.0/a > > Out[2]: > > 2.0 > > a > > ──── > > a > > > In [3]: nsimplify(a**2.0/a) > > Out[3]: a > > > The problem is that 2.0 is not the integer 2 but a float. You have the > > same problem with a**0.5 and a**(1/2). Only the second one is sqrt(a). > > nsimplify simplifies such numerical expression. > > > On 10 January 2012 21:15, Robert <[email protected]> wrote: > > >> a**2.0/a- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
