Source: http://mathematiques.ac-bordeaux.fr/txtoff/prog/lycee/2de_09/doc_ress_algo_v25.pdf