Source: https://dms.umontreal.ca/~rousseac/chapitre_fraction_continue.pdf