Class: Finance::Calculations::Function Private
- Inherits:
-
Object
- Object
- Finance::Calculations::Function
- Defined in:
- lib/finance/calculations.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Base class for working with Newton’s Method. For more details, see Bigdecimal::Newton.
Instance Method Summary collapse
- #eps ⇒ Object private
-
#initialize(values) ⇒ Function
constructor
private
A new instance of Function.
- #one ⇒ Object private
- #ten ⇒ Object private
- #two ⇒ Object private
- #values(x) ⇒ Object private
- #zero ⇒ Object private
Constructor Details
#initialize(values) ⇒ Function
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Function.
112 113 114 115 116 117 118 119 |
# 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 |
Instance Method Details
#eps ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
125 |
# File 'lib/finance/calculations.rb', line 125 def eps ; @eps; end |
#one ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
122 |
# File 'lib/finance/calculations.rb', line 122 def one ; @one; end |
#ten ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
124 |
# File 'lib/finance/calculations.rb', line 124 def ten ; @ten; end |
#two ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
123 |
# File 'lib/finance/calculations.rb', line 123 def two ; @two; end |
#values(x) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
127 |
# File 'lib/finance/calculations.rb', line 127 def values(x); [Finance::Calculations.npv(x[0], @values)]; end |
#zero ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
121 |
# File 'lib/finance/calculations.rb', line 121 def zero; @zero; end |