module Finance::Math

Overview

Collection of specific mathemathical functions.

Extended Modules

Defined in:

finance/math.cr

Instance Method Summary

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

[View source]
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

[View source]
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

[View source]
def periodic_rate(rate : Float64, periods : Int32) #

Returns the periodic rate given the yearly rate.

Finance::Math.periodic_rate(0.12, 12) # => 0.01

[View source]