is BigDecimal Value Multiple of another BigDecimal - Android java.lang

Android examples for java.lang:Math

Description

is BigDecimal Value Multiple of another BigDecimal

Demo Code


//package com.java2s;

import java.math.BigDecimal;

public class Main {
    public static boolean isValueMultiple(BigDecimal value,
            BigDecimal multiplicity) {
        return equal(value.remainder(multiplicity), BigDecimal.ZERO);
    }/*from w w w.  j  a  v  a 2  s  .c o  m*/

    public static boolean equal(BigDecimal first, BigDecimal second) {
        return first.compareTo(second) == 0;
    }
}

Related Tutorials