Simple Algorithm for Arbitrary-Precision Integer Division

Sdílet
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

Komentáře • 10

  • @ZeroGaming-ds7mb
    @ZeroGaming-ds7mb Před 5 lety +18

    8:33 how are you getting 15555 when diving 99999/5 ?

  • @garyhvizdak4725
    @garyhvizdak4725 Před 3 lety +4

    A minor technicality, a signed byte can represent any integer in the range -128 .. +127.

  • @thuannguyenquang180
    @thuannguyenquang180 Před 2 lety +1

    Hi Sir. Do you have any C++ programme to describe for the Alogorithm?

  • @MasterMindmars
    @MasterMindmars Před 4 lety +2

    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

  • @ronensuperexplainer
    @ronensuperexplainer Před 4 lety +2

    ULong Int stands for: "Unsigned Long Int", not "Ultra Long Int"

  • @Contradel
    @Contradel Před 4 lety +1

    How can you do Q = N / A when A is very large because D is very large?

  • @msalperen1
    @msalperen1 Před 5 lety +1

    Hi Justin, thanks for the excellent work. Can you provide a python implentation for this algorithm to see it in work?

  • @zxuiji
    @zxuiji Před 3 lety +1

    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)