upiterbarg / mpmath

Automatically exported from code.google.com/p/mpmath
Other
0 stars 0 forks source link

tanh(mpc('inf', '0')) gives Python exception #114

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
With a current svn checkout of mpmath (r823), running
under Python 2.6 on OS X 10.5.6, I get the following
exception:

Macintosh-3:mpmath dickinsm$ python2.6
Python 2.6.1 (r261:67515, Dec  6 2008, 17:52:06) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from mpmath import mpc, tanh
>>> tanh(mpc('inf', '0'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "mpmath/mptypes.py", line 375, in __repr__
    r = repr(s.real)[4:-1]
  File "mpmath/mptypes.py", line 179, in __repr__
    def __repr__(s): return "mpf('%s')" % to_str(s._mpf_, repr_dps(mp.prec))
  File "mpmath/libmpf.py", line 1151, in to_str
    sign, digits, exponent = to_digits_exp(s, dps+3)
  File "mpmath/libmpf.py", line 1092, in to_digits_exp
    s = mpf_neg(s)
  File "mpmath/libmpf.py", line 614, in mpf_neg
    sign, man, exp, bc = s
ValueError: need more than 2 values to unpack
>>> 

Original issue reported on code.google.com by dicki...@gmail.com on 8 Jan 2009 at 1:07

GoogleCodeExporter commented 9 years ago
Hopefully fixed.

Original comment by fredrik....@gmail.com on 8 Jan 2009 at 1:47