Java floor floor(float value)

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

Description

Returns the greatest integer less than or equal to the float argument

License

Open Source License

Declaration

public static int floor(float value) 

Method Source Code

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

public class Main {
    /**//from   w  w w.  ja  v  a 2  s  .  c  om
     * Returns the greatest integer less than or equal to the float argument
     */
    public static int floor(float value) {
        int i = (int) value;
        return value < i ? i - 1 : i;
    }

    /**
     * Returns the greatest integer less than or equal to the double argument
     */
    public static int floor(double value) {
        int i = (int) value;
        return value < i ? i - 1 : i;
    }
}

Related

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