
Sander Rossel wrote: My decimal numbers got scattered decimated, so I rounded them up. FTFY
Mircea





There are 3.00 people in my household.
Start another thread/rant on dates…





I watched a Youtube video recently and one idea from it has stuck in my head as very strange.
I assume everyone's familiar with the idea that if you divide 1 by 7, you get an infinite decimal extending to the right...
1 / 7 = 0.14285714285714285714285714285714...
But what if you take that the repeating 6 digit sequence indicated and repeat it infinitely to the right followed by a 3...
...2857142857142857142857142857143
That is clearly an infinity (it has infinitely many digits!), but if you multiply it by 7...
7*3 => 21 => 1 carry 2
7*4 => 28 + carried 2 => 30 => 0 carry 3
7*1 => 7 + carried 3 +> 10 => 0 carry 1
7*7 => 49 + carried 1 => 50 => 0 carry 5
7*5 => 35 + carried 5 => 40 => 0 carry 4
7*8 => 56 + carried 4 => 60 => 0 carry 6
7*2 => 14 + carried 6 => 20 => 0 carry 2
7*4 => 28 + carried 2 => 30 => 0 carry 3... Ultimately, you get...
...0000000000000000000000000000001
You have an infinite number of zeroes followed by 1, which is just 1. So this infinite number times 7 equals 1, which means it's also 1/7!
I'd always been told that multiplying infinity by any number resulted in infinity, but this is clearly an infinite number which when multiplied by 7 is 1!






"A little time, a little trouble, your better day"
Badfinger





i don't want to think about it
"A little time, a little trouble, your better day"
Badfinger





As long as it is approximately right, the computer is very happy.





Kenneth Haugland wrote: As long as it is approximately right, the computer is very happy. The accountants aren't!
Also, which AI are you running which expresses emotion?





Im running Marvin from Hitchhiker's guide to the galaxy. It's useless. Not that anyone cares though





Don’t let Marvin near your primary computer, it might blue screen itself, permanently!





You cannot add a 3 to the end of an infinite number, as that converts it to a finite one.





Yep.
Adding it to the 'end' would of course require that you reach the end which means it is no longer infinite.





0.14285714285714285714285714285714
If you multiply this by 3 you get very close to Pi
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity.  Hunter S Thompson  RIP





pkfox wrote: multiply
You meant "add"?





I did thanks
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity.  Hunter S Thompson  RIP





And accountants be like "your infinite number has a rounding error and now the books are off!"





I would not consider 1/7 or its decimal equivalent an infinite number. I think technically it is a rational number.
Unless you are using a special library, then computers (and especially databases) don’t deal that well with these types of numbers.
This is why there are fixed decimals that always round in favor of the bank.





englebart wrote: This is why there are fixed decimals that always round in favor of the bank.
This is incorrect. Bank accounts use "round to nearest or away", where fractional cents are rounded to the nearest value (up or down). If the residue is exactly 0.5 cents, the number is rounded "away"  up for positive, down for negative.
If you are running a credit, this gives you a tiny statistical advantage. If you are running a debit, this gives the bank a tiny statistical advantage. In neither case is this likely to have a measurable effect, unless you aggregate over billions of operations a day.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
 6079 Smith W.





Daniel Pfeffer wrote: Bank accounts use "round to nearest or away", where fractional cents are rounded to the nearest value (up or down)
I couldn't find any regulation that specifies how banks round numbers.
And given 'banks' exist throughout the world I suspect certainly in some places rounding might use different rules.
I worked for a financial company (not a bank) and the rounding was decided by me.
There are multiple rules.
Last time I looked (and can recall) there are three different types of rounding suited to financial transactions. Rather than scientific. Although one of those might also be scientific.
Two of them provide 'better' results than just rounding up on '0.5' otherwise down. Which I suspect you are referring to. That specific method tends to favor a specific result. Because there are 6 digits from 59 but only 4 from 04.





Here you are: Converting to the euro
When the EU introduced the Euro, conversion from the national currencies to the Euro was done using to the rule that I mentioned (perform the calculation exactly, then round to 2 decimal places using 'round to nearest or away'). I assumed that this was the rule used by most banking operations.
Note that the IEEE Std 7542019 FloatingPoint Standard specifies decimal, as well as binary, floatingpoint. Parts of the decimal specification (e.g. the "quantum" concept, and 'round to even or away') were added specifically in order to ease the decimal calculations performed by banks.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
 6079 Smith W.





Daniel Pfeffer wrote: Here you are
Which supports exactly what I said.
Are there ways to round currencies  yes.
Is there more than one way to do it  yes.
I stated both of those.
How does one decide which to use? By law, regulation or just by picking one.
You provided an example where the method was specified for the very specific case.
It specifically supports the different choices also. The following is a way to round currencies:
"it is prohibited to round or truncate the conversion rate."
Instead it provides the rule to be used:
"if the number in the third decimal place is less than 5..."
But it also recognizes other possibilities with the following:
"Introduction of the euro may not alter the terms of legal instruments, "
And this:
"National law can bring more detail to rules on rounding as long as this leads to a higher degree of accuracy."
Daniel Pfeffer wrote: Note that the IEEE Std 7542019
You are merely pointing out ways that one can do it. Which I already said exist.





Explain the problem?
A lot that is infinite to us, can be rounded.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics."  Some Bell.





I was told there would be no math.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix





I think this is closer to philosophy than maths. Certainly a long was from the arithmetic I learned in school!





Instead, realize that there is no math spoon
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.



