module Finance::Math
Overview
Collection of specific mathemathical functions.
Extended Modules
Defined in:
finance/math.crInstance Method Summary
-
#nthrt(n : Int32, value : Float64, precision = 1e-10)
Returns the Nth root of value.
-
#periodic_compound_rate(rate : Float64, periods : Int32)
Returns the periodic compound rate given the yearly rate.
-
#periodic_interests(capital : Float64, periodic_rate : Float64)
Returns the periodic interests due given the remainder and the periodic rate.
-
#periodic_rate(rate : Float64, periods : Int32)
Returns the periodic rate given the yearly rate.
Instance Method Detail
def nthrt(n : Int32, value : Float64, precision = 1e-10)
#
Returns the Nth root of value.
Finance::Math.nthrt(4, 16) # => 2.0
def periodic_compound_rate(rate : Float64, periods : Int32)
#
Returns the periodic compound rate given the yearly rate.
Finance::Math.periodic_compound_rate(0.12, 12) # => 0.009488792934582824
def periodic_interests(capital : Float64, periodic_rate : Float64)
#
Returns the periodic interests due given the remainder and the periodic rate.
Finance::Math.periodic_interests(100, 0.01) # => 1.0
def periodic_rate(rate : Float64, periods : Int32)
#
Returns the periodic rate given the yearly rate.
Finance::Math.periodic_rate(0.12, 12) # => 0.01