[Numpy-discussion] how to use ldexp?

Stéfan van der Walt stefan@sun.ac...
Thu May 21 03:35:54 CDT 2009


Hi Dmitrey

2009/5/21 dmitrey <dmitrey.kroshko@scipy.org>:
> hi all,
> I have tried the example from numpy/add_newdocs.py
>
> np.ldexp(5., 2)
> but instead of the 20 declared there it yields
> TypeError: function not supported for these types, and can't coerce
> safely to supported types

I could not reproduce the problem on current SVN:

In [6]: np.ldexp(5., 2)
Out[6]: 20.0

In [7]: np.ldexp(np.array([5., 2.]), np.array([2, 1]))
Out[7]: array([ 20.,   4.])

Regards
Stéfan


More information about the Numpy-discussion mailing list