Problem 44064. adding huge numbers
Write function called huge_add that adds together two positive integers of any length specified as char vectors using decimal notation. The single output argument is the result and it is a char vector as well. The inputs and output must contain digits only; no commas, spaces or any other characters are allowed. If any of these assumptions are violated by the input, the function returns the number -1. Hint: you cannot use any of the built-in numerical data types of MATLAB to do the calculation since the function needs to work for numbers that are larger than what can be represented as a number in MATLAB.
Solution Stats
Problem Comments
-
1 Comment
The ten tests have been broken out into separate test cases for easier debugging.
Solution Comments
Show commentsProblem Recent Solvers28
Suggested Problems
-
Return the largest number that is adjacent to a zero
5407 Solvers
-
How to find the position of an element in a vector without using the find function
2749 Solvers
-
How many trades represent all the profit?
604 Solvers
-
287 Solvers
-
Area of an equilateral triangle
6391 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!