Class Factorial

java.lang.Object
org.apache.commons.numbers.combinatorics.Factorial

public class Factorial
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    Factorial()  
  • Method Summary

    Modifier and Type Method Description
    static long value​(int n)
    Computes the factorial of n.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • value

      public static long value​(int n)
      Computes the factorial of n.
      Parameters:
      n - Argument.
      Returns:
      n!
      Throws:
      java.lang.IllegalArgumentException - if n < 0.
      java.lang.IllegalArgumentException - if n > 20 (the factorial value is too large to fit in a long).