Java Ceil ceilPositive(float x)

Here you can find the source of ceilPositive(float x)

Description

Returns the smallest integer greater than or equal to the specified float.

License

Apache License

Declaration

static public int ceilPositive(float x) 

Method Source Code

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

public class Main {
    static private final double CEIL = 0.9999999;

    /**//  ww w  . j  a v  a  2  s .c  o m
     * Returns the smallest integer greater than or equal to the specified
     * float. This method will only properly ceil floats that are positive.
     */
    static public int ceilPositive(float x) {
        return (int) (x + CEIL);
    }
}

Related

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