class Finance::Calculations::Function
Base class for working with Newton's Method. For more details, see Bigdecimal::Newton.
@api private
Public Class Methods
new(values)
click to toggle source
# File lib/finance/calculations.rb, line 112 def initialize(values) @zero = BigDecimal("0.0") @one = BigDecimal("1.0") @two = BigDecimal("2.0") @ten = BigDecimal("10.0") @eps = BigDecimal("1.0e-16") @values = values end
Public Instance Methods
eps()
click to toggle source
# File lib/finance/calculations.rb, line 125 def eps ; @eps; end
one()
click to toggle source
# File lib/finance/calculations.rb, line 122 def one ; @one; end
ten()
click to toggle source
# File lib/finance/calculations.rb, line 124 def ten ; @ten; end
two()
click to toggle source
# File lib/finance/calculations.rb, line 123 def two ; @two; end
values(x)
click to toggle source
# File lib/finance/calculations.rb, line 127 def values(x); [Finance::Calculations.npv(x[0], @values)]; end
zero()
click to toggle source
# File lib/finance/calculations.rb, line 121 def zero; @zero; end