data validation
<p>I am writing a loan calculate with data validation. My maximum loan amount is 1,000,000 and I am using the method below to validate. When I enter 1,000,000 into the program it comes back with my error method. I thought (d >= max) would allow me to go up to and including my max. Can anyone see a problem with this method or is it possible I should be looking elsewhere in my code for a problem.</p>

<p>Any help is appreciated.</p>

<pre><code>public static double getDoubleWithinRange(Scanner sc, String prompt, double min, double max)
{
    double d = 0.0;
    boolean isValid = false;
    while (isValid == false)
    {

        d = getDouble (sc, prompt);
        if (d &lt;= min)
        {
            System.out.println(
                    "Error! Number must be greater than " + min + "." );
        }
        else if (d &gt;= max)
        {
            System.out.println("Error! Number must be less than " + max + "." );
        }

        else
            isValid = true;
    }
    return d;
</code></pre>

<p>//Get input from user
            System.out.println("DATA ENTRY");
            double loanAmount = getDoubleWithinRange (sc,
                "Enter loan amount:           ",0, 1000000);
            double interestRate = getDoubleWithinRange (sc,
                "Enter yearly interest rate:  " , 0, 20);
            int years = getIntWithinRange (sc,
                "Enter number of years:       ",0,100);</p>
