Here you can find the source of floor(double x, double y)
public static double floor(double x, double y)
//package com.java2s; public class Main { /**//w w w .ja v a2 s.co m * Truncate x down to the nearest y. */ public static double floor(double x, double y) { return y * Math.floor((x + .00001) / y); } }