Java Number Round roundPositive(float value)

Here you can find the source of roundPositive(float value)

Description

Returns the closest integer to the specified float.

License

Open Source License

Declaration

static public int roundPositive(float value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /** Returns the closest integer to the specified float. This method will only properly round floats that are positive. */
    static public int roundPositive(float value) {
        return (int) (value + 0.5f);
    }/*from  ww w. jav a  2  s.  co  m*/
}

Related

  1. roundOffFileCount(int fileCount)
  2. roundOffTo2DecPlaces(double val)
  3. roundOffValues(double[] doubles)
  4. roundPhred(final double value, final double phredScorePrecision)
  5. roundPos(final float a)
  6. roundPositive(float x)
  7. roundPositiveIntToPowerOf2(int i)
  8. roundPower10(float val, int powerOf10)
  9. roundPower2(final long x)