code: public static long factorial(int n)
      {
          if (n < 0 || n > MAX_LONG_FACTORIAL)
          {
              throw new IllegalArgumentException("Argument must be in the range 0 - 20.");
          }
          long factorial = 1;
          for (int i = n; i > 1; i--)
          {
              factorial *= i;
          }
          return factorial;
      }
docs: Calculates the factorial of n where n is a number in the
  range 0 - 20.  Zero factorial is equal to 1.  For values of
  n greater than 20 you must use {@link #bigFactorial(int)}.
  @param n The factorial to calculate.
  @return The factorial of n.
  @see #bigFactorial(int)