Question:
How to Square in Java Code...?
CambodianCrack
2011-02-15 02:41:26 UTC
I need to write this in java code:
L(R/N)
----------------------------
1-(1+R/N) ^ -NY

I'm having a problem with squaring the denominater by -NY. I just don't know how to write that in java language. Help if you can
Three answers:
cosimo
2011-02-15 02:47:02 UTC
Look at java.math.pow().
anonymous
2011-02-15 10:52:17 UTC
pow() method belonging to math class is used. Its syntax is:

Math.pow(base,exponent);

and returns double value



So statement in java would be;

double ans =( (L*(R/N))/ (1-(Math.pow((1+R/N), (-NY))));
anonymous
2011-02-15 10:58:38 UTC
USING math.pow(x,2)


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...