hi
can you tell me what type of data i should use to store a very large number like 500! (factorial of 500)

thanks

Recommended Answers

All 3 Replies

Something like http://www.mpir.org/ (or http://gmplib.org/ if you're on *nix). Check the documentation for the largest number allowed, as 500! may far exceed it. Remember that 500! is a monstrous number! Check to make sure your assignment isn't to approximate it somehow.

If you do not go towards the better solution of using the above links, then what you want is to use an array. Work by digit by digit.

Thanks alot

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.