Can any one help me to know how to deal with big numbers, like to count the number of digits in factorial of 5*10^9.
or how to make number 20,000 decimal.
array can store only to 10^6, if heap is taken the size could extend up to 10^9.How to deal with numbers having more than that size.
eagerly waiting for reply.
cse.avinash
-1
Junior Poster
Recommended Answers
Jump to PostThere are two ways:
1) Use a big number library. GNU's is well known.
2) Use an int or char array. Make each element hold just one digit of the number. Write a function for each operation you want done. Yes, you might want a matching array, just …
Jump to Post1) No, when I was working with big numbers, I had to "roll my own" handler for very large digits. GNU wasn't well known then (no www, and no internet for me).
2) Since 10 ^ 9 has 10 digits, and since 10 has only 1 one in it, …
Jump to PostSum of logarithms looks more attractive, but to 10**9 takes still time. I did timed loop in my favorite language and it took 7.198 s to calculate value 65657060 for 10**7 and that is still two decades down. Result was accurate at least for 10**5 (456574), which is OK to …
All 9 Replies
Adak
419
Nearly a Posting Virtuoso
cse.avinash
-1
Junior Poster
Adak
419
Nearly a Posting Virtuoso
cse.avinash
-1
Junior Poster
Adak
419
Nearly a Posting Virtuoso
cse.avinash
-1
Junior Poster
Adak
419
Nearly a Posting Virtuoso
N1GHTS
102
Posting Whiz in Training
TrustyTony
888
pyMod
Team Colleague
Featured Poster
jnawrocki
commented:
nice
+2
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.