Java Float Number Round round(float pX)

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

Description

round

License

Open Source License

Declaration

public static int round(float pX) 

Method Source Code

//package com.java2s;

public class Main {
    public static int round(float pX) {
        return floor(pX + 0.5f);
    }/* w  w  w.j  av a2 s.c o m*/

    public static int floor(float pX) {
        return pX > 0 ? (int) pX : (int) pX - 1;
    }
}

Related

  1. round(float f, int i)
  2. round(float f, int n)
  3. round(float input)
  4. round(float input)
  5. round(float number, int fractionalPartSize)
  6. round(float Rval, int Rpl)
  7. round(float Rval, int Rpl)
  8. round(float v)
  9. round(float val, int places)