Java Float Number Divide div(final float a, final float b)

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

Description

An equivalent to div for float

License

Open Source License

Parameter

Parameter Description
a a parameter
b a parameter

Return

a div b

Declaration

final static public float div(final float a, final float b) 

Method Source Code

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

public class Main {
    /**//from  w w w .j  av a2 s  .  c  o m
     * An equivalent to div for float
     *
     * @param a
     * @param b
     * @return a div b
     */
    final static public float div(final float a, final float b) {
        final float div = (int) (a / b);
        if (b >= 0)
            return div;
        else
            return div + 1;
    }
}

Related

  1. div(float f1, float f2)
  2. divide(final float dividend, final float divisor)
  3. Divide_S(float quotient, float divisor)
  4. Divide_SL(final float quotient, final float divisor)