I have a simple equation.
road_length = ROADLENGTH / ROADSPACING
The problem is, I really need road_length to be a whole number because it's used in FOR loop in C++. Currently ROADLENGTH is 78.539 and I can't change it. ROADSPACING is how far one road segment is from the next and is the only other part of the equation I can adjust.
My question is, without guessing and checking a thousand times, is there a way to mathematically solve what ROADSPACING needs to be in order to get road_length to be a whole number? Keep in mind ROADLENGTH will change from road to road, so it's not always going to be 78.539. ROADSPACING is currently 0.1.
I actually get the (int) casting for the last step so it is 785 on the dot, but I didn't want to confuse anyone.