Java tutorial
//package com.java2s; public class Main { /** * Performs a division and rounds downwards to the next integer. * * @param numerator the numerator. * @param denominator the denominator. * @return an integer value. */ public static int divideToFloor(int numerator, int denominator) { Double result = Math.floor((double) numerator / denominator); return result.intValue(); } }