Sept. 29, 2009
7:22 a.m.
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.