Class Factorial


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

      Constructors 
      Constructor Description
      Factorial()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double fact​(double n)
      Factorial on doubles; avoids overflow problems present when using integers.
      static int fact​(int n)
      Factorial
      static long fact​(long n)
      Factorial
      static java.math.BigInteger fact​(java.math.BigInteger n)
      Factorial
      • Methods inherited from class java.lang.Object

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

      • Factorial

        public Factorial()
    • Method Detail

      • fact

        public static long fact​(long n)
        Factorial
      • fact

        public static java.math.BigInteger fact​(java.math.BigInteger n)
        Factorial
      • fact

        public static double fact​(double n)
        Factorial on doubles; avoids overflow problems present when using integers.
        Parameters:
        n - arg on which to compute factorial
        Returns:
        (double approximation to) factorial of largest positive integer <= (n_ + epsilon)
      • fact

        public static int fact​(int n)
        Factorial