[Numpy-discussion] fixed_pt some progress and a question
Neal Becker
ndbecker2@gmail....
Tue Sep 29 09:22:56 CDT 2009
This doesn't work either:
def as_double (self):
import math
def _as_double_1 (x):
return math.ldexp (x, -self.frac_bits)
vecfunc = np.vectorize (_as_double_1, otypes=[np.float])
return vecfunc (self)
In [49]: obj.as_double()
Out[49]: fixed_pt_array([ 0., 1., 2., 3., 4.])
The values are correct, but I wanted a float array, not fixed_pt_array for
output.
More information about the NumPy-Discussion
mailing list