Hey guys, im pretty new to programming, and I just cant figure out how to put this formula into java.
I just cant figure this bastard out, any ideas?
M= p[i(1+i)n ] / [(1+i)n -1]
btw n, would be "to the power of n"
Printable View
Hey guys, im pretty new to programming, and I just cant figure out how to put this formula into java.
I just cant figure this bastard out, any ideas?
M= p[i(1+i)n ] / [(1+i)n -1]
btw n, would be "to the power of n"
Summary of Operators and the Math class may help you get things under wraps.
Typically, when you're trying to indicate you have one item "to the power of" another, you use the ^ sign. Also, when you have only letters, it's useful to include * signs for multiplication. So, correct me if I'm wrong, but are you asking how to do M = p*(i*(1 + i)^n)/((1 + i)^n - 1)?
I believe that is what he means. The only thing you have to change from M = p*(i*(1 + i)^n)/((1 + i)^n - 1) is that instead of x^n you have to make it Math.pow(x, n), because in Java x^n means x XOR n. Java should implement the ** operator like Python...