code: public static double approximateFactorial(int n) {
      double nFac = 1.0;
      for(int i = n; i > 0; i--) {
        nFac *= i;
      }
      return nFac;
    }
docs: Compute the Factorial of n, often written as <code>c!</code> in
  mathematics.
  
  @param n Note: n &gt;= 0
  @return n * (n-1) * (n-2) * ... * 1