Cet arrondit est celui qui produit le moins d'erreur d'un point de vue statistique :
"This method treats positive and negative values symmetrically, and is therefore free of sign bias. More importantly, for reasonable distributions of y values, the average value of the rounded numbers is the same as that of the original numbers."
# Comment arrondir une date ?
Posté par Victor STINNER (site web personnel) . En réponse au journal Cohérence des fonctions d'arrondi. Évalué à 2.
Je me suis frotté aux erreurs d'arrondi en concevant une API C pour manipuler des dates : https://haypo.github.io/pytime.html
J'en garde un drôle de souvenir. Avec le langage C, l'arrondit est implicite et les erreurs faciles à commettre.
L'arrondit Python de la fonction round() est l'arrondit par défaut du très sérieux standard IEEE 754 : https://en.wikipedia.org/wiki/Rounding#Round_half_to_even
Cet arrondit est celui qui produit le moins d'erreur d'un point de vue statistique :
"This method treats positive and negative values symmetrically, and is therefore free of sign bias. More importantly, for reasonable distributions of y values, the average value of the rounded numbers is the same as that of the original numbers."