exponent in a formula

I have been reading, and trying many different things, I need to insert a formula into a program, and generally thats pretty easy. I however have a exponent in this particular formula. I have tried using pow, and exp, but i cant seem to figure out the syntax, or how to correctly put it in.

When the program does run, it outputs the incorrect answer, so i know doing something wrong.

The formula is S = R*[(1+i)^n]-1 / i

Where the numerator is ((1+i)^n) - 1
and the denominator is i

all multiplied by R.

As you can see, im not exactly sure how to write this, and nothing seems to be working. Any ideas on how to get this formula working? or possible some other options for me to read up on to figure it out?

any and all help is greatly appreciated as this is pretty much kicking my butt.
In the math library #include <cmath> you can use the pow function. pow is short for power - it raises x to the power of y.

Google C++ pow function example

Topic archived. No new replies allowed.