Source: https://www.iro.umontreal.ca/~monnier/1215/notes-floats.pdf