xirr_newton_calculator 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/xirr_newton_calculator.rb +1 -1
  2. metadata +1 -1
@@ -37,7 +37,7 @@ class XirrNewtonCalculator
37
37
  end
38
38
 
39
39
  def dfdx(x)
40
- @flows.inject(0) do |result, flow|
40
+ @flows[1..-1].inject(0) do |result, flow|
41
41
  diff_date = (Date.parse(flow.date.to_s) - Date.parse(@flows[0].date.to_s))/365
42
42
  result += flow.amount* diff_date * x.to_f ** (diff_date -1)
43
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xirr_newton_calculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: