Java Number Round roundLong(double a)

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

Description

Returns a double rounded to the nearest integer.

License

Open Source License

Parameter

Parameter Description
a double to be rounded

Return

long containing the rounded number.

Declaration

public static long roundLong(double a) 

Method Source Code

//package com.java2s;

public class Main {
    /** Returns a double rounded to the nearest integer.
     * @param a double to be rounded/*w w w.  j  a  v a  2s. c  o  m*/
     * @return long containing the rounded number.
     */
    public static long roundLong(double a) {
        return (long) Math.floor(a + 0.5);
    }
}

Related

  1. rounding(double val)
  2. roundingRightShift(int x, int count)
  3. roundIntegerToNearestUpperTenth(int a)
  4. roundInventorySize(final int size)
  5. roundJs(double v, int n)
  6. roundM(int n, int m)
  7. roundMinAndMax(double min, double max, int tickCount)
  8. roundMultiplier(double n)
  9. roundNearest(double v, double target)