I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 0.12
sub units 0.00
+
0

log factorial

Calculates the logarithm of the factorial with given argument.
Controller: CodeCogs

Interface

C++
Excel

Log Factorial

 
doublelog_factorialintn )
This function calculates the following expression

In the given example, values of this function are returned for various integral values of the argument from 1 up to 10.

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

nthe 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.