c:math:factorial_double_num

C++ Reference

double factorial (float num) {

     if(num > 1)
          return num*factorial(num-1);              
     return 1;

}