Smallest float different from 0.0?

kj at
Mon Sep 7 17:34:41 CEST 2009

In <f253109c-1da7-45f6-82e4-77fdeda64a9e at> Mark Dickinson <dickinsm at> writes:

>On Sep 7, 3:47=A0pm, kj <no.em... at> wrote:
>> Is there some standardized way (e.g. some "official" module of such
>> limit constants) to get the smallest positive float that Python
>> will regard as distinct from 0.0?
>> TIA!
>> kj

>There's sys.float_info.min:

>>>> import sys
>>>> sys.float_info

Ah!  I'd seen sys.float_info when searched for this online, but
incorrectly inferred that it was the name of a module.

This is what I was looking for.



More information about the Python-list mailing list