Factorial.

hii friends
........this is the question which is asked in interviews..

how i find the factorial of number whose range is larger than long double and how we store it ?

can any one tell how this is possible ?
By using recursion. Figure out the Math part first.
I wonder if it would be considered "cheating" to point out that the cstdint header makes this a bit of an obsolete question?
^ ┬┐how so?

@OP: checkout a bignum library.
Ooops! I thought that the cstdint header had a data type 128-bit width. I must of been thinking of the __int128 extension in GCC.
still, you could reach a higher maximum with floating type (losing precision in the process)
Topic archived. No new replies allowed.