Converting frequency to time (SOLVED)

Thank you for the input guys.

to get the result in microseconds. (but it SHOULD be 1000000

Thanks johnerrington, in my haste to transpose from my laptop to desktop, I miss counted zeros. I've updated that and the usage of the word double rather than unsigned long.

I hadn't thought about the fact that the 1000000 is larger than what could be stored in a standard int or float. I'll swap that over to UL and simplify the equation to

 cycle_time = 1000000UL / frequency; 

This looks to be the most simple solution. I'll post my results.

As a side question, when asking for assistance in something this simple, is it better etiquette to post only the necessary code as I did here, or the entire sketch, of nearly 200 lines, which has been properly commented?

Thank you guys again.