This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Formula Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Formula Help" Watch "Formula Help" New topic

Formula Help

El Flocko

Joined: Jun 22, 2004
Posts: 1
Evening All:

I am really new to java, and was wondering if anyone know (and be willing to share) how one would write this formula in Java? It is part of a larger project, and I am driving myself nuts trying to get it to work.

PPn = A*(1+i)^n-1 � Po*i(1+i)^n-1

(In case I typed it incorrectly, the n-1 is to the n power-1)

I understand having to import the java.Math, but am really confused as to the order to put it in. Thank you all in advance!

"If I wanted to hear the pitter-patter of little feet, I would put shoes on my cat."
Darin Niard
Ranch Hand

Joined: Jun 08, 2004
Posts: 118
Math.pow(A*(1+i),n-1) - Math.pow(Po*i*(1+i),n-1)

I don't know what exactly Po is.. but... just use Math.pow and lots of parentheses
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
El Flocko,

Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

Thanks Pardner! Hope to see you 'round the Ranch!

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: Formula Help
It's not a secret anymore!