Here you can find the source of floorInt(Double d, double intv)
public static Double floorInt(Double d, double intv)
//package com.java2s; //License from project: LGPL public class Main { public static Double floorInt(Double d, double intv) { if (d < 0) { d -= intv * 0.9999999;/*w w w. j av a 2s . c o m*/ } d = d / intv; d = d < 0 ? Math.ceil(d - 0.0000000000001) : Math.floor(d + 0.0000000000001); return d * intv; } }