Source: http://reds.heig-vd.ch/share/cours/a_doc_manuel/ElecNum_T2.pdf