Hi, On 6 July 2011 04:59, Aaron Meurer <[email protected]> wrote:
> I just noticed that RealDomain.div was recently cleared (i.e., the > contents of the function were deleted, but not the function itself, > nor its docstring). This was done by the commit (I also pasted the > first part of the diff, so you could see what I am talking about) > > commit 75c8d2d65085895c30be515a99c2413e311df873 > Author: Mateusz Paprocki <[email protected]> > Date: Sat May 21 13:21:44 2011 +0200 > > Enabled preprocessing algorithm in roots() (#1868) > > This allows to do the following: > > In [1]: var('J,L,E,F') > Out[1]: (J, L, E, F) > > In [2]: f = -21601054687500000000*E**8*J**8/L**16 + \ > ...: 508232812500000000*F*x*E**7*J**7/L**14 - \ > ...: 4269543750000000*E**6*F**2*J**6*x**2/L**12 + \ > ...: 16194716250000*E**5*F**3*J**5*x**3/L**10 - \ > ...: 27633173750*E**4*F**4*J**4*x**4/L**8 + \ > ...: 14840215*E**3*F**5*J**3*x**5/L**6 + \ > ...: 54794*E**2*F**6*J**2*x**6/(5*L**4) - \ > ...: 1153*E*J*F**7*x**7/(80*L**2) + \ > ...: 633*F**8*x**8/160000 > > In [3]: roots(f.evalf(), x) > Out[3]: > ⎧97.1168816800648⋅E⋅J 791.549343830097⋅E⋅J 1273.16678129348⋅E⋅J > ⎪────────────────────: 1, ────────────────────: 1, ────────────────────: > 1, > ⎨ 2 2 2 > ⎪ F⋅L F⋅L F⋅L > ⎩ > > 503.441004174773⋅E⋅J 186.946430171876⋅E⋅J 1850.10650616851⋅E⋅J > ────────────────────: 1, ────────────────────: 1, ────────────────────: > 1, > 2 2 2 > F⋅L F⋅L F⋅L > > 245.526792947065⋅E⋅J -1304.88375606366⋅E⋅J ⎫ > ────────────────────: 1, ─────────────────────: 1⎪ > 2 2 ⎬ > F⋅L F⋅L ⎪ > ⎭ > > diff --git a/sympy/polys/domains/realdomain.py > b/sympy/polys/domains/realdomain.py > index b8dad3f..202b2ab 100644 > --- a/sympy/polys/domains/realdomain.py > +++ b/sympy/polys/domains/realdomain.py > @@ -102,4 +102,11 @@ def rem(self, a, b): > > def div(self, a, b): > """Division of `a` and `b`, implies `__div__`. """ > - return a / b, self.zero > + > + def gcd(self, a, b): > + """Returns GCD of `a` and `b`. """ > + return self.one > + > + def lcm(self, a, b): > + """Returns LCM of `a` and `b`. """ > + return a*b > > Was this intentional? > No. This happened by accident. It seems that RR.div isn't used anywhere in the code, but anyway, this has to be fixed. > > Aaron Meurer > Mateusz -- 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.
