[Numpy-discussion] Floating point question

Gideon Simpson simpson@math.toronto....
Mon Mar 2 14:59:42 CST 2009


On Mar 2, 2009, at 4:00 PM, Michael S. Gilbert wrote:

>
> 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


When I first discovered this, I was computing:

numpy.exp(-x**2)

If you try x = 26.7, you'll get
2.4877503498797906e-310

I then confirmed this by dividing 1. by 2. until python decided the  
answer was 0.0

-gideon



More information about the Numpy-discussion mailing list