tag:blogger.com,1999:blog-3993498847203183398.post4408902414817232737..comments2021-09-18T11:03:33.766+01:00Comments on RevK<sup>®</sup>'s ramblings: Big number mathsRevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-3993498847203183398.post-42613711803338572402020-03-16T22:27:32.413+00:002020-03-16T22:27:32.413+00:00Worth a look at:
https://en.wikipedia.org/wiki/IEE...Worth a look at:<br />https://en.wikipedia.org/wiki/IEEE_754#Rounding_rulesAndrew Benhamhttps://www.blogger.com/profile/09131573238572089428noreply@blogger.comtag:blogger.com,1999:blog-3993498847203183398.post-88317834369566872822020-03-16T12:59:12.648+00:002020-03-16T12:59:12.648+00:00I thought the same, but no. The bias introduced is...I thought the same, but no. The bias introduced is the amount added/subtracted as part of the rounding - you want that, on average, to be zero. Do it with 1 place to simply. You have 5 "down" and 5 "up", but the 5 "down" are -0.0, -0.1, -0.2, -0.3, -0.4 (average -0.2) and the "up" are +0.5, +0.4, +0.3, +0.2, +0.1 (average +0.3). So bias. Assuming random / even distribution of 0.0 to 0.9 you, on average, change the numbers by +0.05 if you always round up at 0.5.RevKhttps://www.blogger.com/profile/12369263214193333422noreply@blogger.comtag:blogger.com,1999:blog-3993498847203183398.post-5428191613018914742020-03-16T12:52:31.656+00:002020-03-16T12:52:31.656+00:00I'm puzzled about the apparent bias in 'no...I'm puzzled about the apparent bias in 'normal' rounding - and I've never heard of 'bankers rounding' before.<br /><br />Consider an input of numbers to 3 decimal places - so there are 1000 datapoints between integer X and (just below) integer X+1. These datapoints range from X.000 to X.999 .<br />With normal rounding, 500 datapoints (X.000 to X.499) are rounded down to integer X. and 500 datapoints (X.500 to X.999) are rounded up to integer X+1. Doesn't seem any bias there.<br />So, am I missing something ?<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3993498847203183398.post-63526621006430958282020-03-09T07:45:11.234+00:002020-03-09T07:45:11.234+00:00See the P.S. on the post ^See the P.S. on the post ^RevKhttps://www.blogger.com/profile/12369263214193333422noreply@blogger.comtag:blogger.com,1999:blog-3993498847203183398.post-14900802761231298222020-03-08T20:46:05.273+00:002020-03-08T20:46:05.273+00:00I may be missing something, but why in bankers rou...I may be missing something, but why in bankers rounding does 2.5 round to 2 yet 3.5 rounds to 4?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3993498847203183398.post-40513775830214886732020-03-08T19:57:45.444+00:002020-03-08T19:57:45.444+00:00I was going to say "python3 just does this&qu...I was going to say "python3 just does this" until I got to your final example:<br /><br />>>> 1e1000000000+1<br />inf<br />Stevehttps://www.blogger.com/profile/05381505486152944884noreply@blogger.com