log factorial
Calculates the logarithm of the factorial with given argument.
Controller: CodeCogs
Interface
C++
Excel
Log Factorial
doublelog_factorial( | int | n | ) |
Example 1
#include <codecogs/maths/arithmetic/log_factorial.h> #include <iostream> #include <iomanip> int main() { std::cout << std::setprecision(10); for (int i = 1; i <= 10; i++) { std::cout << "log_factorial(" << i << ") = "; std::cout << Maths::Arithmetic::log_factorial(i); std::cout << std::endl; } return 0; }
Output
log_factorial(1) = 0 log_factorial(2) = 0.6931471806 log_factorial(3) = 1.791759469 log_factorial(4) = 3.17805383 log_factorial(5) = 4.787491743 log_factorial(6) = 6.579251212 log_factorial(7) = 8.525161361 log_factorial(8) = 10.6046029 log_factorial(9) = 12.80182748 log_factorial(10) = 15.10441257
Parameters
n the argument of the factorial
Returns
- the logarithm of the factorial with given argument n
Authors
- Lucian Bentea (September 2005)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.