[Numpy-discussion] Epsilon for each dtype

Fabrice Silva silva at lma.cnrs-mrs.fr
Mon Dec 10 06:16:39 EST 2007


Le lundi 10 décembre 2007 à 11:38 +0100, Matthieu Brucher a écrit :
> Hi,
> Is there somewhere a equivalent to std::numerical_limits<>::epsilon,
> that is, the greatest value such that 1. + epsilon is numerically
> equal to 1. ?
> I saw something that could be related in oldnumeric, but nothing in
> numpy itself. 

if X is a numpy object:
numpy.finfo(type(X)).eps gives the epsilon of the type of X.
You may look at other attributes of finfo too..

-- 
Fabrice Silva <silva at lma.cnrs-mrs.fr>
LMA UPR CNRS 7051




More information about the NumPy-Discussion mailing list