Question: C++ Accurately adding large numbers using stacks If you work in scientific environments, you may have to deal with large numbers that are not floating

C++

Accurately adding large numbers using stacks

If you work in scientific environments, you may have to deal with large numbers that are not floating point. There can be subtle rounding errors in doubles and floats because of how the numbers are stored, with sign, exponent, mantissa. If you want very accurate, very large numbers another approach is needed.

You can use stacks to add very large numbers. You may use the stack template to implement stacks.

Read in from a file two very large numbers and store them in the stacks, add the result.

Display the resulting answer.

Make sure your code is commented!!!!!!

Sample run

Enter 1st number to be added

398877192309843792837423784

Enter 2nd number to be added

434820384038402384023840234

Answer is: 398877192309843792837423784 + 434820384038402384023840234 = 833697576348246176861264018

Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!