[Numpy-discussion] np.finfo().maxexp confusing
Tue Oct 11 15:55:50 CDT 2011
On Tue, Oct 11, 2011 at 2:39 PM, Matthew Brett <firstname.lastname@example.org> wrote:
> I realize it is probably too late to do anything about this, but:
> In : info = np.finfo(np.float32)
> In : info.minexp
> Out: -126
> In : info.maxexp
> Out: 128
> minexp is correct, in that 2**(-126) is the minimum value for the
> exponent part of float32. But maxexp is not correct, because 2**(127)
> is the maximum value for the float32 exponent part:
> There is the same maxexp+1 feature for the other float types.
> Is this a sufficiently quiet corner of the API that it might be
> changed in the future with suitable warnings?
Ah - I just found this:
which explains that:
maxexp int Smallest (positive) power of ibeta that causes overflow.
which is - unpleasantly named, but at least, clearly documented - if
not at the point of use. When I've got better internet access, I'll
try and modify the finfo docstring to explain.
More information about the NumPy-Discussion