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:
z = 1
while True:
try:
z = z+1
except OverflowError:
z = z-1
break
Here is my full 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 >nul")
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.
I know the smallest number in python would be negative but I want to get the the smallest number above zero.