Jump to content
  • Advertisement
Sign in to follow this  
Wutalife37

Big Numbers

This topic is 5035 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I have done some work on the Erdos-Strauss Conjecture, and I think I have found a new way how to calculate results. Currently, a method has been developed that has calculated a solution for every number up to 10^14. I would like to match that number with my method. The problem is, I can't seem to find any way how to support numbers that large. Since the method I have involves multiplication, I may need to use numbers as large as 10^20 in my calculations. I also need to use an effecient language for this sort of thing, because as it is it will probably take days to run the program. Can anyone suggest a language to use, and a way to use numbers so large?

Share this post


Link to post
Share on other sites
Advertisement
I believe LISP supports ints of any size. And if you want to use c or c++ you can use
http://www.swox.com/gmp/

I'm assuming you only need ints (rationals shouldn't be to hard to add).

I've never used gmp, and my LISP is limited. So you may want to look for more experienced suggestions.

Share this post


Link to post
Share on other sites
Just in case you use Java you can use the BigInteger class. I actually don't know the limits for the numbers used, but i think it'll be ok. Once i experimentated and calcultated the factorial of 1000 (which is pretty big). And it was decently fast too.

Share this post


Link to post
Share on other sites
Under ANSI C++ you should have a variable keyword called the long long which according to specification should be 64 bits, i.e. ranged from 0 to 18446744073709551615.

Share this post


Link to post
Share on other sites
Quote:
Original post by Inmate2993
Under ANSI C++ you should have a variable keyword called the long long which according to specification should be 64 bits, i.e. ranged from 0 to 18446744073709551615.


That's not actually enough for 10^20, log-base 10 of 2^64 is only 19, which means you can only get up to 10^19 out of 2^64 bits.

I, personally, despite how much I despise LISP and its derivitives, have had great success using Scheme for large integer calculations. I've also used a BigInteger class in C# that supports memory-sized integers that works pretty nicely and can link in with any .NET language.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Still, 19 is close to 20, and with a little tweeking of the algorithm it might just be enough. It would certainly make the program run faster, especially on 64 bit hardware.

Share this post


Link to post
Share on other sites
Quote:
Original post by Wutalife37
Hello. I have done some work on the Erdos-Strauss Conjecture, and I think I have found a new way how to calculate results. Currently, a method has been developed that has calculated a solution for every number up to 10^14. I would like to match that number with my method.


Hey, can you please bring this on topic? How is it related to game development?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Hey, can you please bring this on topic? How is it related to game development?


Isn't this the Math and Physics forum?

Share this post


Link to post
Share on other sites
Sorry, I didn't know it needed to be related to game development for this forum. If necessary, I have no problem with it being moved to the general programming section.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!