Big Integer Multiplication - MATLAB Cody - MATLAB Central

Problem 42636. Big Integer Multiplication

Difficulty:Rate

Implement big integer multiply.

Input:

A, B : N-by-M Matrix, each row represents a positive decimal integer.

Output:

C : N-by-P Matrix, each row represents the decimal integer A*B.

Example 1:

a = [1 2 3;0 5 6];
b = [5 6;9 0];
c = BigIntMult(a,b)
c =
   6     8     8     8
   5     0     4     0

123*56=6888 (c(1,:)), 56*90=5040 (c(2,:))

Example 2 (singleton expansion):

a = [1 2 3;0 5 6];
b = [5 7];
c = BigIntMult(a,b)
c =
   7     0     1     1
   3     1     9     2

123*57=7011 (c(1,:)), 56*57=3192 (c(2,:))

Note:

1.you don't need to remove the leading zeroes.

2.your score will depend on your solution performance.

Solution Stats

40.46% Correct | 59.54% Incorrect
Last Solution submitted on Sep 08, 2024

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
2
3

Problem Recent Solvers7

Suggested Problems

More from this Author8

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!