Java Float Number Round round(float a)

Here you can find the source of round(float a)

Description

Rounds the number to the closest integer

License

Open Source License

Parameter

Parameter Description
a the number

Return

the closest integer

Declaration

public static int round(float a) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from   www .  j a  va2s .c  o m*/
     * Rounds the number to the closest integer
     * @param a the number
     * @return the closest integer
     */
    public static int round(float a) {
        return Math.round(a);
    }

    /**
     * Rounds the number to the closest integer
     * @param a the number
     * @return the closest integer
     */
    public static long round(double a) {
        return Math.round(a);
    }
}

Related

  1. round(final float a)
  2. round(final float f)
  3. round(final float val)
  4. round(final float value)
  5. round(final float x, final float roundFactor)
  6. round(float amount, int cent)
  7. round(float axisValue)
  8. round(float d)
  9. round(float f, int dp)