Skip to content

A tiny Python experiment

The ball that never hits the wall… until Python says it does

In maths, halving the gap forever never reaches zero. In Python, floats eventually run out of precision, so starting from 1.0 the gap becomes exactly 0.0 after 1,075 halvings.

Run the paradox

gap = 1.0
step = 0
while gap > 0:
    gap /= 2
    step += 1
print(f"IMPACT at step {step}")

Expected output

IMPACT at step 1075

Try it

Change the starting gap and predict the step before running.

Get the free FileFlow organizer →

Turn a useful script into a practical project

Build the FileFlow Organizer

Learn how a Python file organizer previews moves, handles collisions and keeps an undo journal. The guided course is separate from the free organizer.