Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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();
    }
}