I would first determine the least common multiple (LCM) of R and P, which is almost entry level algorithmic. Then divide S by the LCM, and multiply the LCM by the integer part of the result of that division.
That's effectively, exactly what I was doing, but in my sleep-deprived state, I was convinced that I could avoid the iteration and calculate the result directly, despite that I couldn't see how. Hence my question. Thank you.
In reply to Re^2: Simple arithmetic?
by BrowserUk
in thread Simple arithmetic?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |