an efficient algorithm for Mul & Div of big numbers

salardx

New member
Joined
Nov 10, 2022
Messages
1
Hi, we got 2 big decimal numbers, like these two:

9999999999999999999999999999.9999999999999999999999999999
8888888888888888888888888888.8888888888888888888888888888

We are looking for an efficient algorithm to multiply and divide these 2 numbers
Any help would be highly appreciated
 
Hi, we got 2 big decimal numbers, like these two:

9999999999999999999999999999.9999999999999999999999999999
8888888888888888888888888888.8888888888888888888888888888

We are looking for an efficient algorithm to multiply and divide these 2 numbers
Any help would be highly appreciated
For multiplication, look into the Karatsuba or Schonhage-Strassen. (I'm more familiar with the first).
For division, I think regular long division works just fine.
 
Last edited:
9999999999999999999999999999.9999999999999999999999999999
8888888888888888888888888888.8888888888888888888888888888

We are looking for an efficient algorithm to [ ... ] divide these 2 numbers

Notice the following two examples.

\(\displaystyle \ \dfrac{9.9}{8.8} \ = \ \dfrac{1.1(9)}{1.1(8)} \ = \ \dfrac{9}{8}\)

\(\displaystyle \ \dfrac{99.99}{88.88} \ = \ \dfrac{11.11(9)}{11.11(8)} \ = \ \dfrac{9}{8}\)

Now, apply this pattern to divide the original pair of numbers.
 
Hi, we got 2 big decimal numbers, like these two:

9999999999999999999999999999.9999999999999999999999999999
8888888888888888888888888888.8888888888888888888888888888

We are looking for an efficient algorithm to multiply and divide these 2 numbers
Any help would be highly appreciated
Of course, these particularly numbers can be written as, respectively, 10^28 - 10^-28 and (8/9)*(10^28 - 10^-28), if I counted digits correctly. And you can multiply and divide those expressions a little more easily.

Or did you mean "like these two" in a broader sense?
 
Top