Code example for BigInteger

Methods: equals, multiply, subtract

0
import java.math.BigInteger; 
 
public class Fakultaet 
{ 
    public static BigInteger fakultaetBig(BigInteger n)
    { 
        if(n.equals(1))
        { 
            return (new BigInteger("1"));
        }else{ 
            return( n.multiply(fakultaetBig( n.subtract (new BigInteger("1")) )));
        } 
    } 
 
    public static int fakultaet(int n)
    { 
        if(n == 1)
        { 
            return 1; 
        }else{ 
            return( n * (fakultaet(n-1)));
        }