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. Matthieu -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher
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@lma.cnrs-mrs.fr> LMA UPR CNRS 7051
Excellent, that was what I was looking for, thank you. Matthieu 2007/12/10, Fabrice Silva <silva@lma.cnrs-mrs.fr>:
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@lma.cnrs-mrs.fr> LMA UPR CNRS 7051
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
-- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher
participants (2)
-
Fabrice Silva
-
Matthieu Brucher