From: Drew Olson Date: 2007-03-30T06:08:24+09:00 Subject: Re: Ruby math.pow equivalent John Butler wrote: > Hi, > > I am trying to calculate a monthly payment for a loan in Ruby. Does > anyone know what the equivalent for math.pow in Java is for Ruby? > > @monthlypayment = @principal*@rate/(1-Math.pow(1/(1+@rate),@payments)) > > Ive searched everywhere and cant seem to find anything. > > thanks > > Johnny B I think this is what you're looking for: irb(main):001:0> 2 ** 1 => 2 irb(main):002:0> 2 ** 2 => 4 irb(main):003:0> 2 ** 3 => 8 irb(main):004:0> 2 ** 4 => 16 -- Posted via http://www.ruby-forum.com/.