Simple Algorithm for Arbitrary-Precision Integer Division
Vložit
- čas přidán 21. 10. 2015
- Writing a set of steps to divide two very large numbers isn't as easy as it sounds!
For more information, go to justinparrtech.com and search for INTEGER DIVISION. - Věda a technologie
8:33 how are you getting 15555 when diving 99999/5 ?
A minor technicality, a signed byte can represent any integer in the range -128 .. +127.
Hi Sir. Do you have any C++ programme to describe for the Alogorithm?
I don't want to divide, because a large number is very difficult to divide. I prefer Newton - Raphson method because it substitute division by multiplication:
P= 10^d d=number of numerator digits - 1
Shift decimal point left of b, d times: b = b / P
1) Xn+1= Xn•(2 - b•Xn)
2) error = Xn+1 - Xn
3) if error < precision 4), else 1)
4) Quotient = dividend x Xn+1
ULong Int stands for: "Unsigned Long Int", not "Ultra Long Int"
How can you do Q = N / A when A is very large because D is very large?
Hi Justin, thanks for the excellent work. Can you provide a python implentation for this algorithm to see it in work?
the bucket analogy is poor explanation of division, it only gives a misnomer explanation, division is the number of times a value can be reduced by another value, this correct explanation leads to the natural understanding that any number divided by 0 results in 0 just as any number multiplied by 0 results in 0 (because multiplication starts at the opposite end, 0 and adds the original number the specified number of times)