lib/finance/time_value.rb
def compound_return(periods,present_value,future_value)
      pv = present_value.to_d
      fv = future_value.to_d
      n = periods.to_d
      rate = ((fv / pv)**(1/n))-1
    end
##
# determine the rate of return over a period
# *periods - number of periods (years) that the interest is cumulated
# *present_value - the value at the start of the period
# *future_value - the value at the end of the period
#
determine the rate of return over a period
periods - number of periods (years) that the interest is cumulated
present_value - the value at the start of the period
future_value - the value at the end of the period
determine the rate of return over a period periods - number of periods ( years ) that the interest is cumulated present_value - the value at the start of the period future_value - the value at the end of the period
def compound_return(periods,present_value,future_value)
      pv = present_value.to_d
      fv = future_value.to_d
      n = periods.to_d
      rate = ((fv / pv)**(1/n))-1
    end
def compound_return ( periods , present_value , future_value ) pv = present_value . to_d fv = future_value . to_d n = periods . to_d rate = ( ( fv / pv ) ** ( 1 / n ) ) - 1 end
determine the rate of return over a period
periods - number of periods (years) that the interest is cumulated
present_value - the value at the start of the period
future_value - the value at the end of the period
determine the rate of return over a period periods - number of periods ( years ) that the interest is cumulated present_value - the value at the start of the period future_value - the value at the end of the period
periods
present_value
future_value