A class for operations with Large Integer Numbers

Hi. Help me, please! Why this class doesn't work for Subtraction, Division and Square Root. When I try to get results for Subtraction, it output right answer, but with any trash. And When I try to get answer for Division and Square Root, it just brakes and don't output anything. For Addition and Multiplication class work correctly. Thank U very mush, if you will help me.

Its the link to this class

http://www.codeproject.com/Articles/...nteger-Numbers

Re: A class for operations with Large Integer Numbers

Quote:

Originally Posted by

**Pahanuch**
Hi. Help me, please! Why this class doesn't work for Subtraction, Division and Square Root. When I try to get results for Subtraction, it output right answer, but with any trash.

Have you debugged the code yourself? You have the source code, so why don't you step through it with the debugger?

Regards,

Paul McKenzie

Re: A class for operations with Large Integer Numbers

this class seems to solve the large number problem by implementing the storage as a string. And then doing all the operations "like you did in elementary school with a sheet of paper".

This is adequate for simple math problems or for problems where conversion to strings is happening often.

It is going to be very very slow for "complex" or lengthy math operations on really big numbers. (lets say something like finding the greatest common denominator between 2 50 digit numbers).

This may be what you need, or it may not.

Search around you will find classes based around arrays of integers (i.e. binary storage). These will be slower at converting to/from a string representation. But they will be considerably faster at actual math operations.