Introduction to CS | 6.4: Fixing Bisection Search for Numbers Below One

Full course — free exercises, Feynman reviews, and AI-graded feedback: https://ludium.ai/courses/intro-cs-py... The bisection square-root code works beautifully for big numbers, then quietly loops forever when you ask for the square root of a fraction like 0.5. The reason is subtle: for numbers below one, the answer lies outside the search range we set up. This video debugs the infinite loop with print statements, finds the hidden assumption, and fixes the bounds so the code works for every input. Key concepts covered: Why the square root of a number below one is larger than the number How a bad search interval causes an infinite loop Using print statements to debug a loop that never ends Widening the bounds so bisection works for fractions ━━━━━━━━━━━━━━━━━━━━━━━━ SOURCE MATERIALS The source materials for this video are from    • Lecture 6: Bisection Search