Code example for BigInteger

Methods: gcd, intValue

0
    public static int f(int x, int n){
         
        return (new Random(x)).nextInt(n);
    } 
    private static int gcdThing(int a, int b) {
    BigInteger b1 = new BigInteger(""+a); // there's a better way to do this. I forget.
    BigInteger b2 = new BigInteger(""+b);
    BigInteger gcd = b1.gcd(b2);
    return gcd.intValue();
} 
}