Ongeveer 57 resultaten
Koppelingen in nieuw tabblad openen
  1. python - Calculate the factorial of a number - Stack Overflow

    19 jul. 2023 · Define a function called calculate_factorial that takes in one parameter, number. Inside the function, write code to calculate the factorial of the given number. The factorial of a number is the pr...

  2. python - recursive factorial function - Stack Overflow

    How can I combine these two functions into one recursive function to have this result: factorial(6) 1! = 1 2! = 2 3! = 6 4! = 24 5! = 120 6! = 720 This is the current code for my factorial functi...

  3. Function for factorial in Python - Stack Overflow

    27 feb. 2011 · How do I go about computing a factorial of an integer in Python? 4 function calls in 5.164 seconds Using the stack is convenient (like recursive call), but it comes at a cost: storing detailed …

  4. Factorial using Recursion in Java - Stack Overflow

    18 nov. 2011 · I am learning Java using the book Java: The Complete Reference. Currently I am working on the topic Recursion. Please Note: There are similar questions on stackoverflow. I searched them …

  5. Is there a method that calculates a factorial in Java?

    21 mei 2009 · Quite nice idea. considering, that factorial first 20 is probably enough, i would add a static constants (no need to calculate it every time app launch) to Math class with those data provided. Fact …

  6. Is there any built-in factorial function in c++? - Stack Overflow

    2 mei 2018 · I have searched but I was not able to find this. Would anyone please tell me that if there is any built-in factorial function in c++ ?

  7. Factorial in C without conditionals, loops and arithmetic operators

    12 nov. 2012 · How can I find the factorial of a number (from 1 to 10) in C, without using: loop statements like for, while, and do while; conditional operators like if and case; and arithmetic …

  8. javascript - factorial of a number - Stack Overflow

    The code above first defines two variables, factorialNumber and factorial. factorial is initialized with 1. factorialNumber will get the result of the prompt (a number is expected) and then, using a cycle, in …

  9. Fast algorithms for computing the factorial - Stack Overflow

    15 apr. 2013 · I found FastFactorialFunctions describing a number of algorithms for computing the factorial. Unfortunately, the explanations are terse and I don't feel like sifting through line after line of …

  10. Python lambda function to calculate factorial of a number

    14 mrt. 2013 · I have just started learning python. I came across lambda functions. On one of the problems, the author asked to write a one liner lambda function for factorial of a number. This is the …