[Numpy-discussion] Floating point question

Michael S. Gilbert michael.s.gilbert@gmail....
Mon Mar 2 15:00:16 CST 2009


On Mon, 2 Mar 2009 15:37:33 -0500, Gideon Simpson wrote:
> My two questions are:
> 
> 1.  What is the best way to handle this?  Is it just to add a filter  
> of the form
> 
> 	u = u * ( np.abs(u) > 2.3 e-308)
> 
> 2.  What gives?  What's the origin of this (perceived) inconsistency  
> in floating points across languages within the same platform?

how are you calculating fmin?  numpy has a built-in function that
will tell you this information:

>>> numpy.finfo( numpy.float ).min
-1.7976931348623157e+308

hopefully this helps shed some light on your questions.

regards,
mike


More information about the Numpy-discussion mailing list