Here you can find the source of floor(double d)
public static final int floor(double d)
//package com.java2s; // {LICENSE}/*from w w w .java 2 s. c o m*/ public class Main { private static final int INT = 16384; private static final double FLOOR = INT + 0.0000; public static final int floor(double d) { return (int) (d + FLOOR) - INT; } }