Java floor floor(float x)

Here you can find the source of floor(float x)

Description

floor

License

Apache License

Declaration

public static int floor(float x) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int floor(float x) {
        return (int) (Math.floor(x) + 0.5f);
    }/*from   ww  w  . j  a  v a 2  s.c o m*/

    public static int floor(double x) {
        return (int) (Math.floor(x) + (x > 0 ? 0.5 : -0.5));
    }
}

Related

  1. floor(float f)
  2. floor(float f)
  3. floor(float f)
  4. floor(float value)
  5. floor(float value)
  6. floor(int f)
  7. floor(int number, int divisor)
  8. floor(int x, int quantum)
  9. floor(Integer a)