Java Ceil ceilingAbs(double a)

Here you can find the source of ceilingAbs(double a)

Description

Returns ceiling for absolute value of a, keeping the sign.

License

Open Source License

Declaration

public static int ceilingAbs(double a) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

public class Main {
    /** Returns ceiling for absolute value of a, keeping the sign. */
    public static int ceilingAbs(double a) {
        int ceil = (int) a;
        if (a >= 0) {
            return a > (double) ceil ? ceil + 1 : ceil;
        } else {//from  ww w  .  ja v a2  s .  c  om
            return a < (double) ceil ? ceil - 1 : ceil;
        }
    }
}

Related

  1. ceilDivide(long a, long b)
  2. ceilDivision(int value, int divisor)
  3. ceiling(double d)
  4. ceiling(double d)
  5. ceiling_float_int(float value)
  6. ceilingHalf(int num)
  7. ceilingNextPowerOfTwo(final int x)
  8. ceilingPow2(int n)
  9. ceilingPowerOf2(final int n)