Java floor floor(float value)

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

Description

Returns the largest integer less than or equal to the specified float.

License

Open Source License

Declaration

static public int floor(float value) 

Method Source Code

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

public class Main {
    static private final int BIG_ENOUGH_INT = 16 * 1024;
    static private final double BIG_ENOUGH_FLOOR = BIG_ENOUGH_INT;

    /** Returns the largest integer less than or equal to the specified float. This method will only properly floor floats from
     * -(2^14) to (Float.MAX_VALUE - 2^14). */
    static public int floor(float value) {
        return (int) (value + BIG_ENOUGH_FLOOR) - BIG_ENOUGH_INT;
    }//  ww w .  jav a 2 s  .c o m
}

Related

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