{"id":11966,"date":"2022-02-17T00:00:04","date_gmt":"2022-02-17T04:00:04","guid":{"rendered":"http:\/\/nycphantom.com\/journal\/?p=11966"},"modified":"2022-02-17T00:00:05","modified_gmt":"2022-02-17T04:00:05","slug":"bankers-rounding","status":"publish","type":"post","link":"http:\/\/nycphantom.com\/journal\/?p=11966","title":{"rendered":"Banker's Rounding"},"content":{"rendered":"\n<p>While briefing through this Python course by TIQC (very good course, very interactive, great professor Jake Gober), a question came up in the second video: Why is round(10.5) = 10? I'm not sure if the professor had the chance to talk about it, and I had to look up this strange phenomenon.<\/p>\n\n\n\n<p>It turns out that it is true, that it will round to the closest even choice. So round(10.5) = 10, while round(11.5) = 12. Because those are the closest even numbers to round to.<\/p>\n\n\n\n<p>But what's going on? Apparently it's called <a href=\"https:\/\/softwareengineering.stackexchange.com\/questions\/256265\/why-do-some-languages-round-to-the-nearest-even-integer\">Banker's Rounding<\/a>. It seems to be a unbias way for bankers to deal with rounding numbers, so as not to not over pay or under pay interests.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While briefing through this Python course by TIQC (very good course, very interactive, great professor Jake Gober), a question came up in the second video: Why is round(10.5) = 10? I'm not sure if the professor had the chance to &hellip; <a href=\"http:\/\/nycphantom.com\/journal\/?p=11966\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-11966","post","type-post","status-publish","format-standard","hentry","category-technical"],"_links":{"self":[{"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts\/11966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11966"}],"version-history":[{"count":1,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts\/11966\/revisions"}],"predecessor-version":[{"id":11967,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts\/11966\/revisions\/11967"}],"wp:attachment":[{"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11966"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}