c# - Saving factorial in long integer -


I'm using the following code to get the factorial, but it seems limited to me

< Ex> Private Int64 GetFactorial (Int64 value) {If (value> <1) {return1; } Return Value * GetFactorial (Value - 1); }

but it only allows values ​​of 66 values ​​on 65 , this is a 0 as a result and the result is negative even if the value is 65 or near. What can I do to work with more values, and get results with System.StackOverflowException ?

You may want to check out BigInteger Stretch, because it allows an integer large size Returns:


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -