Trying to find smallest number
<p>In my program I'm trying to find the smallest number that python can give me. When I kept dividing a number by 2, I got 5 x 10^-324 (5e-324). I thought I could divide this by the biggest number I can use in python. I tried to get the biggest number in python by doing this:</p>

<pre><code>z = 1
    while True:
        try:
            z = z+1
        except OverflowError:
            z = z-1
            break
</code></pre>

<hr>

<p>Here is my full code:</p>

<pre><code>from os import system
x = 76556758478567587
while True:
    x = x/2
    if x/2 == 0.0:
        break

print("Smallest number I can compute:", x)
print()
z = 1
while True:
    try:
        z = z+1
    except OverflowError:
        z = z-1
        break

print(str(x) + " divided by " + str(z) + " is...")
z = x/z
print(z)
system("pause &gt;nul")
</code></pre>

<p>Every time I run this it does nothing. I suddenly recognize it's still trying to solve the problem so I open task manager and Python was eating up my CPU like a pack of wolves eating a dead cow.</p>

<hr>

<p>I know the smallest number in python would be negative but I want to get the the smallest number <strong>above zero</strong>.</p>

<p>The smallest floating point number representable in Python is <code>5e-324</code>, or <code>2.0**-1075</code>.</p>

<p>The other two answers have each given you half of what you need to find this number. It can be found by multiplying <code>sys.float_info.min</code> (<code>2.2250738585072014e-308</code>, the smallest normalized float) by <code>sys.float_info.epsilon</code> (<code>2.220446049250313e-16</code>, the smallest proportion you can modify a number by while still getting a distinct value).</p>

python numbers