Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   200 digit number!!!!! READ (http://www.go4expert.com/forums/200-digit-number-read-t23023/)

Qxx1 16Aug2010 15:31

200 digit number!!!!! READ
 
how to perform addition substraction on a 200 digit number in 'C'?????
how to read that big number??
i have to do it in float.
someone spoke of 'big float', wat is that??

micsom_micsom 17Aug2010 16:47

Re: 200 digit number!!!!! READ
 
Try using a Linked List , the Node can have the Digit, the carryover,....

Its a simple program.

xpi0t0s 17Aug2010 17:54

Re: 200 digit number!!!!! READ
 
You can't do it with the built-in types; you will have to implement your own. One way is to represent the numbers with strings, e.g.
Code:

char *pi="3.1415926535897932384626450288";
which will retain its accuracy as long as you want it to (i.e. there is no conversion to binary).

Adding/subtracting numbers will be just an implementation of how you did this back in school. Remember doing sums like this one?
12345
2008+
=====

5+8 is 13, carry 1 and write 3. 4+0+1 is 5. And so on.


All times are GMT +5.5. The time now is 19:22.