Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3785 by peterj...@gmail.com: log(Rational(3,10),10) regression
http://code.google.com/p/sympy/issues/detail?id=3785

At gitref `366591a`, the following runs without error:

Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
from sympy import log, Rational
log(Rational(3,10),10)
(-log(10) + log(3))/log(10)


Shortly after at gitref `5894b32`, it errors:
...
from sympy import log, Rational
log(Rational(3,10),10)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sympy/core/cache.py", line 92, in wrapper
    func_cache_it_cache[k] = r = func(*args, **kw_args)
  File "sympy/core/function.py", line 280, in __new__
    result = super(Function, cls).__new__(cls, *args, **options)
  File "sympy/core/cache.py", line 92, in wrapper
    func_cache_it_cache[k] = r = func(*args, **kw_args)
  File "sympy/core/function.py", line 126, in __new__
    evaluated = cls.eval(*args)
  File "sympy/functions/elementary/exponential.py", line 496, in eval
    return n + log(arg // base ** n) / log(base)
TypeError: unsupported operand type(s) for //: 'Rational' and 'Rational'

Also erroring:
log(Rational(2,7),7)
log(Rational(2,14),7)


Obviously past the error point it cannot be used as a building block in other expressions, such as attempting to find its decimal approximation via .evalf()

log(Rational(3,10),10).evalf()
-0.522878745280338

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy-issues+unsubscr...@googlegroups.com.
To post to this group, send email to sympy-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to