Computers didn't learn rounding at school
When you learn how to round at school you're told that the midpoint always goes up. So 4.5 rounds up to 5. Well, actually 'up' is a little confusing as -4.5 rounds to -5. Basically you round to the bigger absolute number.
Computers, and indeed most of the non-pure maths world, do something else. This is because of a bias. The bias can best be explained by an example:
Say you have 10 things to divide up between two people, one of whom gets 3/4 and the other gets the remaining 1/4.
Easy enough maths: one gets 7.5 and one gets 2.5
Only, we can't split these things, so let's round:
7.5 rounds up to 8, 2.5 rounds up to 3.