Java Ceil ceilInt(Double d, double intv)

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

Description

ceil Int

License

LGPL

Declaration

public static Double ceilInt(Double d, double intv) 

Method Source Code

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

public class Main {
    public static Double ceilInt(Double d, double intv) {
        return floorInt(d, intv) + intv;
    }/*from w w w.  j a va  2 s  .c  o  m*/

    public static Double floorInt(Double d, double intv) {
        if (d < 0) {
            d -= intv * 0.9999999;
        }
        d = d / intv;
        d = d < 0 ? Math.ceil(d - 0.0000000000001) : Math.floor(d + 0.0000000000001);
        return d * intv;
    }
}

Related

  1. ceilingPow2(int n)
  2. ceilingPowerOf2(final int n)
  3. ceilingPowerOf2(int n)
  4. ceilingPowerOfTwo(final int a)
  5. ceilingPowerOfTwo(int value)
  6. ceilInt(final double x)
  7. ceilLogBaseTwo(final int i)
  8. ceilMaskPOT(int n)
  9. ceilMultiple(float source, float multiple)