Here you can find the source of floor(float value)
public static int floor(float value)
//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; } }