Shadow Posted February 9, 2008 Posted February 9, 2008 Well, here I am with another C oriented question. To put it simply, what if an unsigned long long int data type just isn't enough? If you want a specific example of why I need this; I made a program that generates Fibonacci Numbers. You can input how many numbers you want generated. Unfortunately, I can't generate more than 94 of them, because then the numbers are just too big for the data type to remember. How can I get around that? I know it must be possible, otherwise how could we know for example that the biggest prime number (yet found I mean) is [math]2^{32,582,657}-1[/math]? Thanks in advance for any help
timo Posted February 10, 2008 Posted February 10, 2008 C does not naturally support large integer numbers, as far as I know. So you either have to write the structures for large integers yourself, get some module doing that from the internet or switch to a programming language that supports large integers.
Shadow Posted February 10, 2008 Author Posted February 10, 2008 Ok, thanks. Any links for the modules, while I'm at it?
Aeternus Posted February 10, 2008 Posted February 10, 2008 http://gmplib.org/ or take a look at some of the stuff here - http://www.google.co.uk/search?q=C+precision+number+library&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now