I
I
igor292013-12-22 13:57:54
Java
igor29, 2013-12-22 13:57:54

How to write a correct formula in Java?

Hello. There is a mathematical formula: Tell me
Untitled.jpg
how to write it correctly, since my version is:
double paymentsCount = Math.log (1 / 1 - Im * 100 / Ap)/Math.log(1+Im)
throws an exception, despite the fact that the input data correct.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2013-12-22
@igor29

double paymentsCount = Math.log(1 / (1 - Im * 100 / Ap))/Math.log(1+Im)

B
Beholder, 2013-12-27
@Beholder

Isn't it better to simplify and not to lose accuracy once again to replace with
- Math.log(1 - Im * 100 / Ap) / Math.log(1 + Im)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question