Here you can find the source of floor(double num)
public static int floor(double num)
//package com.java2s; // it under the terms of the GNU General Public License as published by public class Main { public static int floor(double num) { final int numInt = (int) num; return numInt == num ? numInt : numInt - (int) (Double.doubleToRawLongBits(num) >>> 63); }//from w w w.j av a 2 s . c o m }