Okay, haven’t thought about this problem for a while and only have a minute to do it, so someone please correct if wrong
Let x = fraction gained per month (i.e., % gain divided by 100)
Let n = number of months
Let y = yield
Let I = orginal investment
First month, n=1
Y = I * (1+x)
Second month, n=2
Y = [I * (1+x)] (1+x) = I*(1+x)^2
The formula I come up with is Y = I * (1+x)^n
You could do this with days too, as long as you estimate x in those terms, which would get you closer to continuous compounding. sorry, no time to do a swarm example right now.