Java BigDecimal Multiply multiple(BigDecimal dividend, int divisor)

Here you can find the source of multiple(BigDecimal dividend, int divisor)

Description

multiple

License

Open Source License

Declaration

public static boolean multiple(BigDecimal dividend, int divisor) 

Method Source Code


//package com.java2s;
/*//  www  .ja v  a  2s .  c o  m
 * Este programa es software libre; usted puede redistribuirlo y/o modificarlo bajo los terminos
 * de la licencia "GNU General Public License" publicada por la Fundacion "Free Software Foundation".
 * Este programa se distribuye con la esperanza de que pueda ser util, pero SIN NINGUNA GARANTIA;
 * vea la licencia "GNU General Public License" para obtener mas informacion.
 */

import java.math.BigDecimal;
import java.math.BigInteger;

public class Main {
    public static boolean multiple(Byte dividend, int divisor) {
        return dividend != null && divisor != 0 && dividend % divisor == 0;
    }

    public static boolean multiple(Short dividend, int divisor) {
        return dividend != null && divisor != 0 && dividend % divisor == 0;
    }

    public static boolean multiple(Integer dividend, int divisor) {
        return dividend != null && divisor != 0 && dividend % divisor == 0;
    }

    public static boolean multiple(Long dividend, int divisor) {
        return dividend != null && divisor != 0 && dividend % divisor == 0;
    }

    public static boolean multiple(Float dividend, int divisor) {
        return dividend != null && divisor != 0 && dividend % divisor == 0;
    }

    public static boolean multiple(Double dividend, int divisor) {
        return dividend != null && divisor != 0 && dividend % divisor == 0;
    }

    public static boolean multiple(BigInteger dividend, int divisor) {
        return dividend != null && divisor != 0
                && dividend.remainder(BigInteger.valueOf(divisor)).equals(BigInteger.ZERO);
    }

    public static boolean multiple(BigDecimal dividend, int divisor) {
        return dividend != null && divisor != 0
                && dividend.remainder(BigDecimal.valueOf(divisor)).equals(BigDecimal.ZERO);
    }
}

Related

  1. mul(BigDecimal b1, BigDecimal b2)
  2. mul(BigDecimal d1, BigDecimal d2)
  3. mul(BigDecimal v1, BigDecimal v2)
  4. mul(BigDecimal v1, BigDecimal v2)
  5. multiply(BigDecimal a, BigDecimal b)
  6. multiply(BigDecimal a, int multiplier)
  7. multiply(BigDecimal amount, BigDecimal multiplicand, int scale)
  8. multiply(BigDecimal aValue1, BigDecimal aValue2)