Need help - I would like to set a limit to a double variable : first post here. I am a beginner so bare with me.
I am building a program to help my self and a co-worker quote jobs (We work in a machine shop). 

This part of the program is for calculating how long it takes to face a part. 
It starts with some basic info, work piece diameter, feed rate and surface speed you want to tool to operate at. Then it runs a while loop, each time the tool advances 0.010", it calculates the new rpm the piece will rotate at and calculates the time for that cut adding it all up at the end. 

The problem: I need to be able to limit the rpms. As the tool gets closer to the center of the work piece the rpms will climb to a very high unattainable rpm, I want to be able to set a limit, 2000 for example. 

I cannot figure out how to do that with out affecting my loop... I have searched, but I'm such a noob maybe I've stumbled across a solution that would work and never realized it, or I am not searching for the correct key words. Here is my code:
 
    public static void main(String[] args) {
        double startRadius = 6; //Radius of stock diameter
        double faceFinish = 0; 
        double feed = .010; //Amount the tool will advance per revolution
        double sfm = 200; //Surface speed of tool (Surface feet per minute)
        double rpm = 0;
        double totalTime = 0;

        while(faceFinish < startRadius) {
            startRadius -= feed; //reduces diameter by feed
            rpm = (sfm * 3.82) / (startRadius * 2); //establishes new rpm per tool advance            
            totalTime += (feed / (feed * rpm)) * 60;
        }
        int hours = (int) (totalTime / 3600);
        int minutes = (int) ((totalTime % 3600) / 60);
        int seconds = (int) (totalTime % 60);
        System.out.printf("%02d:%02d:%02d\n", hours, minutes, seconds);
    }

Thank you for any advice. 

