Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Formula Help

 
El Flocko
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!



 
Darin Niard
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic