Java floor floorInt(Double d, double intv)

Here you can find the source of floorInt(Double d, double intv)

Description

floor Int

License

LGPL

Declaration

public static Double floorInt(Double d, double intv) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static Double floorInt(Double d, double intv) {
        if (d < 0) {
            d -= intv * 0.9999999;/*w  w w.  j av  a 2s . c o  m*/
        }
        d = d / intv;
        d = d < 0 ? Math.ceil(d - 0.0000000000001) : Math.floor(d + 0.0000000000001);
        return d * intv;
    }
}

Related

  1. floorDivide(int value, int divisor)
  2. floorDivide(long n, long d)
  3. floorDivide(long numerator, long denominator)
  4. floorDivision(int i, int divisor)
  5. floorHalf(int num)
  6. floorInt(float x)
  7. floorLogBaseTwo(final int i)
  8. floorLong(final double x)
  9. floormod(float a, float b)