Here you can find the source of factorial(final long value)
Parameter | Description |
---|---|
value | - value to take the factorial of |
public static long factorial(final long value)
//package com.java2s; public class Main { /**/*from w w w .j av a 2 s . c o m*/ * Takes the factorial of a value. * * @param value - value to take the factorial of * @return - the value's factorial */ public static long factorial(final long value) { long fac = 1; for (int i = 0; i < value; i++) { fac *= (value - i); } return fac; } }