Here you can find the source of isDivisible(BigDecimal num1, BigDecimal num2)
public static boolean isDivisible(BigDecimal num1, BigDecimal num2)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static boolean isDivisible(BigDecimal num1, BigDecimal num2) { BigDecimal result = remainder(num1, num2); return result.compareTo(BigDecimal.ZERO) == 0 ? true : false; }/*from w ww . j a va 2 s . c o m*/ public static BigDecimal remainder(BigDecimal num1, BigDecimal num2) { if (null == num2 || BigDecimal.ZERO.compareTo(num2) == 0) { return null; } if (null == num1 || BigDecimal.ZERO.compareTo(num1) == 0) { return BigDecimal.ZERO; } return num1.remainder(num2); } }