Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Rounding a number to nearest even
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Lie, post: 3534375"] It's not round up, why? In the usual sense -- when not comparing against round-half-even -- the number range we're talking is from x to lim((x+1)-y)[y -> 0 from the positive side], e.g. 1 to nearly 2 (thus the integer 2 itself is not included in the number range we're talking since it belongs to the next set), then we choose a uniformly distributed samples, i.e. 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, and 1.9. From these samples, we chose which are rounded down and which are rounded up, it happens that 1.0 is rounded down, while 1.5 is rounded up. IF for the sake of argument, you choose the number range to be lim(x + y)[y -> 0 from the positive side] to x + 1, e.g. barely above 1 to 2, then the number sample you use is 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, and 2.0, in this second number range, there are 5 round downs (1.1, 1.2, 1.3, 1.4, 1.5) and 5 round ups (1.6, 1.7, 1.8, 1.9, 2.0), but how logical is it to choose this number range (barely above 1 to 2) against choosing the more natural range (1 to nearly 2): in the correctly chosen number range (1 to nearly 2) all numbers in the form of 1.x (where x is any positive number and 0) is contained within it and there is nothing else in it, but in the second number range (barely above 1 to 2) the number 1.0 is not included while the number 2.0 is contained in it, clearly not a clean separation of numbers in the form of y.x where y is pre-determined and x is variable from other possible values of y. In short, choosing that x.0 is rounded down and x.5 is rounded up is arbitrary but not without a reason. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Rounding a number to nearest even
Top