Java Double Number Divide div(double a, double b)

Here you can find the source of div(double a, double b)

Description

An integer division function suitable for our purpose.

License

Open Source License

Parameter

Parameter Description
a the dividend.
b the divisor.

Return

the quotient of integer division.

Declaration

public static long div(double a, double b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**// w  w w .j av  a 2s . c o  m
     * An integer division function suitable for our purpose.
     *
     * @param a the dividend.
     * @param b the divisor.
     * @return the quotient of integer division.
     */
    public static long div(double a, double b) {
        return (long) Math.floor(a / b);
    }
}

Related

  1. calculateRoundDoubleQuotientOfTowIntegerNumber(Integer dividend, Integer divisor)
  2. ceil_divide(float left, float right)
  3. div(double a, double b)
  4. div(double a, double b)
  5. div(double a, double b)
  6. div(Double dividend, Double quotient)
  7. div(double divisor, int dividend, int preciseFigures)
  8. div(double left, double right)