Java Number Round roundPos(final float a)

Here you can find the source of roundPos(final float a)

Description

Round a positive a

License

Open Source License

Parameter

Parameter Description
a a parameter

Declaration

final static public int roundPos(final float a) 

Method Source Code

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

public class Main {
    /**//from   w  ww .  j  a  v a  2  s. co  m
     * Round a positive a
     *
     * @param a
     */
    final static public int roundPos(final float a) {
        return (int) (a + 0.5f);
    }

    /**
     * Round a positive a
     *
     * @param a
     */
    final static public int roundPos(final double a) {
        return (int) (a + 0.5);
    }
}

Related

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