Converting frequency to time (SOLVED)

The simplest solution worked perfectly! My loop() now has a valid number to hand off to my pwm() function. so, I'm using:

int frequency, cycle_time;
frequency = (400 to 1000);

cycle_time = 1000000UL / frequency; // Gives cycle period in microseconds

I will take your advice next time johnwasser and put together a small sketch that demonstrates the problem rather than trying to describe it. I was just afraid of getting someone caught up on bad programming outside of the line at issue. Probably putting that line in bold would not be a bad idea.

One last question. Should I include simplified sketches for attempts to solve the issue? Coming here was my last option, not my first. I explored several dozen options of changing the variable types, both in setup and inline with the math as a single line and in two lines. I literally spent hours trying ideas I knew probably would not work, but needed to exclude from being a possible solution. Obviously, I would not include all of the explored option iterations, but maybe the 3 or 4 most extreme from the original code.