From 0a610a756ab30bb7e19dd0eca0fca058a3695a1e Mon Sep 17 00:00:00 2001 From: Leo Gertsenshteyn Date: Fri, 30 Mar 2018 11:08:12 -0700 Subject: [PATCH] Clarify that round(x) uses half-to-even rounding see https://docs.python.org/3.6/library/functions.html#round --- 03 Python Overview.ipynb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/03 Python Overview.ipynb b/03 Python Overview.ipynb index 3d71086..3215f7b 100644 --- a/03 Python Overview.ipynb +++ b/03 Python Overview.ipynb @@ -472,8 +472,10 @@ "outputs": [], "source": [ "print(int(2.5)) # Convert to int with truncation\n", - "print(round(2.5)) # Convert to int with rounding (this one is odd; I'd expect it to round up)\n", - "print(round(2.5001)) # Convert to int with rounding" + "print(round(2.4999)) # Convert to int with rounding\n", + "print(round(2.5001)) # Convert to int with rounding\n", + "print(round(2.5)) # Convert to int with rounding (rounds half to nearest even)\n", + "print(round(3.5)) # Convert to int with rounding (rounds half to nearest even)\n" ] }, {