TypeError when using double , longdouble in numpy.dot

Dear NumPy developers, I am trying to solve some scipy.sparse TypeError failures reported in [1] and reduced them to the following example:
import numpy a = numpy.array([[1]])
numpy.dot(a.astype('single'), a.astype('longdouble')) array([[1.0]], dtype=float64)
numpy.dot(a.astype('double'), a.astype('longdouble')) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: array cannot be safely cast to required type
Is this exception expected? Also I noticed this:
numpy.array([1]).astype('longdouble').dtype.num 13 numpy.array([1.0]).astype('longdouble').dtype.num 12
I am using Python 2.6.5 for Windows and numpy 1.4.1 compiled with msvc9, where sizeof(longdouble) == sizeof(double). [1] http://aspn.activestate.com/ASPN/Mail/Message/scipy-user/3875416 -- Christoph

participants (3)
-
Charles R Harris
-
Christoph Gohlke
-
David Cournapeau