-
Calculating Factorial
Hi,
I want to write C++ program to calculate the factorial for numbers from 1 until 255, the problem is that no variable exist as far as I know that can handle the result for calculating 140! And greater “I am not sure about the number but it is stuck at some level”..
Someone advise me to use this library “http://gmplib.org/” to solve the issue but I couldn’t use the library as I am beginner in programming field..
Can you advise me about a solution or how to use this library step by step ..
-- Put in your mind that the result from the factorial will be added to a formula (i.e. I will add it or multiply it by another values, so the will program will calculate the factorial as a part of the complete formula “the big formula”). I am saying that to let you know that the array solution is not helpful in my case.
Thanks.
-
I took a quick look at GMP and it seems like the right choice for you. Rather than using functions to perform your arithmetic (like you need to in C), the classes provided in the C++ wrapper overload operators such as + and - for you.
have a look at the manual
http://gmplib.org/manual/C_002b_002b...lass-Interface
-
There's really no other option than to use a third party library to store the results. Have a look at the manual that dra suggested and come back to us with any questions.
QuantumPete
-
Thanks Guys...
which files i need to dlownload from http://gmplib.org/?
My operating system is Win XP.
I am using Microsoft Visual Studio 2005.
After downloading what is the next step to embed the library in my program?