is Divisible BigInteger - Java java.math

Java examples for java.math:BigInteger

Description

is Divisible BigInteger

Demo Code


import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Arraycopy;
import java.util.Random;
import static java.math.BigInteger.ONE;
import static java.math.BigInteger.ZERO;

public class Main{
    public static void main(String[] argv) throws Exception{
        BigInteger a = new BigInteger("1234");
        BigInteger b = new BigInteger("1234");
        System.out.println(isDivisible(a,b));
    }//from   w  w  w.j a  v a2s . c o m
    public static boolean isDivisible(BigInteger a, BigInteger b) {
        return a.remainder(b).compareTo(ZERO) == 0;
    }
}

Related Tutorials