#!/usr/bin/python3 # Bisection.py # Trouver un zéro par la méthode de bisection a, b = 1.0, 2.0 # intervalle initial c = (a + b) / 2 # bisection initial epsilon = 1.0E-5 # tolérance def f(x): return x**5 - x - 1 while b - a >= 2*epsilon: if f(a)*f(c) <= 0: b = c else: a = c c = (a + b) / 2 print("Le zero est à x =", c)