Closed
Description
Original ticket http://projects.scipy.org/numpy/ticket/1684 on 2010-11-22 by trac user lamblin, assigned to unknown.
If I create an array containing the minimal value of an int dtype, for instance an 'int8' array containing -128, numpy.allclose fails to detect it is "close" to itself, although it is equal.
>>> a = numpy.asarray(-128, dtype='int8')
>>> numpy.all(a == a)
True
>>> numpy.allclose(a, a)
False
I would expect:
>>> numpy.allclose(a, a)
True
This is due to the fact that the tolerance uses numpy.absolute, and in that case, it is negative:
>>> numpy.absolute(a)
array([-128], dtype=int8)
I reproduced the same with int16 and -215, int32 and -231, and int64 and -2**63.