If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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.

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.