bug with numpy.float64

Issue #1 resolved
geerk created an issue
Python 2.7.3 (87aa9de10f9c, Nov 24 2013, 20:57:21)
[PyPy 2.2.1 with GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``the world doesn't want us to
know''
>>>> from decimal import Decimal
>>>> import numpy as np
>>>> x = np.float64(1.0)
>>>> Decimal.from_float(x)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/timofey/workspace/pypy/lib-python/2.7/decimal.py", line 691, in from_float
    n, d = abs(f).as_integer_ratio()
TypeError: unsupported operand type for as_integer_ratio: 'float64'
>>>> Decimal.from_float(float(x))
Decimal('1')
>>>> 

Comments (2)

  1. Log in to comment