Im trying to compute the amount of interest earned on $1 over different amounts of time. Im using the formula P = C(1 + r/n)nt but my answers seem to fluctuate too much especially the higher the interest rate or the time compounded.

For instance $1 compounded at 12% over 5 years should come out to $1.76. I end up getting $1.82

$1 compounded at 16% * 10 years should be $4.41. I get $4.95

$1 compounded at 22% * 25 years should be $144.00. I get $244.28

$1 compounded at 24% * 30 years should be $635.00 I get $1336.26

Is this the right formula or am i doing this wrong?