Here you can find the source of floor(double d)
public static int floor(double d)
//package com.java2s; //License from project: LGPL public class Main { /**//from www . ja va2s . c om * Unchecked implementation to round a number down. Parameter should be known to be valid in advance. */ public static int floor(double d) { int i = (int) d; return d < i ? i - 1 : i; } }