[Numpy-discussion] Rounding to next lowest float
Tue Oct 11 14:43:01 CDT 2011
On Tue, Oct 11, 2011 at 3:20 PM, Colin J. Williams
> If you are using integers, why not use Python's Long?
You mean, why do I need to know the next lowest representable integer
in a float type?
It's because I have a floating point array that I'm converting to
integers, and I'm trying to find the right threshold for clipping the
floating point array, to stop this happening:
In : np.array([2**32], np.float).astype(np.int32)
I need then to clip my floating point input array at some maximum
floating point value ``M``, such that in_type(M).astype(out_type) <=
X, where X is the maximum of the out_type.
More information about the NumPy-Discussion