Java Ceil ceilMultiple(float source, float multiple)

Here you can find the source of ceilMultiple(float source, float multiple)

Description

ceil Multiple

License

Open Source License

Declaration

public static float ceilMultiple(float source, float multiple) 

Method Source Code

//package com.java2s;

public class Main {
    public static float ceilMultiple(float source, float multiple) {
        if (source > 0) {
            float tmp = source - 1;
            return tmp + (multiple - (tmp % multiple));
        } else {/*from  w  w  w. j  a v a 2  s. c  om*/
            return source + (-source % multiple);
        }
    }
}

Related

  1. ceilingPowerOfTwo(int value)
  2. ceilInt(Double d, double intv)
  3. ceilInt(final double x)
  4. ceilLogBaseTwo(final int i)
  5. ceilMaskPOT(int n)
  6. ceilPositive(float x)
  7. ceilPoT(int arg)
  8. ceilPow2(int v)
  9. ceilPowerOf2(final long x)