class Factorial {

	public static long factorial(int number) {
		if (number < FACTORIAL_MIN_ARGUMENT) {
			String message = String.format("Faktorijela nije definirana za %d.", number);

			throw new IllegalArgumentException(message);
		}
		else if (number > FACTORIAL_MAX_ARGUMENT) {
			String message = String.format("%d! ne stane u long.", number);

			throw new IllegalArgumentException(message);
		}

		long factorial = 1;

		for (int i = 1; i <= number; ++i) {
			factorial *= i;
		}

		return factorial;
	}

}