Top "Factorial" questions

In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n.

Find factorial of large numbers in Java

I tried to find the factorial of a large number e.g. 8785856 in a typical way using for-loop and double …

java factorial largenumber
When calculating the factorial of 100 (100!) with Java using integers I get 0

When doing this: int x = 100; int result = 1; for (int i = 1; i < (x + 1); i++) { result = (result * i); } System.out.println(…

java overflow int factorial
Factorial of a large number in python

Here's my approach to factorials: def factorial(n): '''Returns factorial of n''' r = 1 for i in range(1, n + 1): r *= i …

python algorithm factorial
Calculate the factorial of an arbitrarily large number, showing all the digits

I was recently asked, in an interview, to describe a method to calculate the factorial of any arbitrarily large number; …

c++ factorial
How to check whether a no is factorial or not?

I have a problem, then given some input number n, we have to check whether the no is factorial of …

c performance algorithm factorial
Calculate 100 factorial with all the digits

I came across a problem of calculating 100 factorial. Here is what I tried first in Perl to calculate 100! : #!/usr/bin/…

perl factorial bigint
Cannot calculate factorials bigger than 20! ! How to do so?

I am using unsigned long long integer format in order to calculate big factorials. However my code fails at some …

c gcc factorial
StackOverflowError computing factorial of a BigInteger?

I am trying to write a Java program to calculate factorial of a large number. It seems BigInteger is not …

java algorithm stack-overflow biginteger factorial
Factorial with R

I can't calculate the factorial of 365 by using factorial(365) with the R logial, I think the capacity of this logicial …

r factorial