Source: https://www.lyceedadultes.fr/sitepedagogique/documents/math/math2S/Ctrle_devoir_10_11_2ndeS/Chapitre_5_Devoir_fnt_algo_28_02_2011.pdf