fast_xirr 1.0.1 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f24d77d9ffd418ab7083fa4920995dc0976349a683265662abb481b6e264a2a2
4
- data.tar.gz: 5d9a9feeacf8a6c436c68322763bf0a5177227cb3bab131cfe041e6853888df2
3
+ metadata.gz: 4836e4f3499607c058d627e0718c1415bc7bfd23f750f9df413dc6c4527ee6a7
4
+ data.tar.gz: 9331bdb84b707c270c5e29d914dd9e6eeb814d102a1e0b3a25322e3e67435c73
5
5
  SHA512:
6
- metadata.gz: fa37a038365b015b4f879e9057ee7ac664c02475c56879e5cccaabef4f11a5847dc529e4963d127f2807d4ed074b0b62b2e83848a463bd9505dcd40044e2190d
7
- data.tar.gz: 679fe4163ae248a8e03256e8a98da5b4abb6e1e88653703b9a218a74d03fe7b11681e4ec83386706ead27b8ec47ccaf8df29336bdf4367a32021314ef80c4f46
6
+ metadata.gz: e130e92d55d75e71b706ece17b6318c36924c69aae09b1b34320369a912b2ead4dc76caded2446ebe93389a3f6db9a55f65979a108a68feefadfe1511b87b39f
7
+ data.tar.gz: fed653b1893283b35d72846300995bee86e7fb452fcb66cda23d2285bcf97fda3b99c7c2a83719ed275336944e7aed712051b1d6f2031db64624705ef35256b7
@@ -66,13 +66,12 @@ int find_bracketing_interval(CashFlow *cashflows, long long count, double *low,
66
66
  }
67
67
 
68
68
  // Extend the search range if no interval is found within the initial range
69
- step = 10.0;
70
- for (double rate = max_rate + step; rate <= 10000.0; rate += step) {
69
+ for (double rate = max_rate; rate <= 1e300; rate *= 1.5) {
71
70
  double npv_rate = npv(rate, cashflows, count, min_date);
72
71
 
73
72
  // Check if the function values at consecutive rates have opposite signs
74
73
  if (npv_min_rate * npv_rate < 0) {
75
- *low = rate - step;
74
+ *low = rate / 1.5;
76
75
  *high = rate;
77
76
  return 1;
78
77
  }
@@ -1,4 +1,4 @@
1
1
  module FastXirr
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_xirr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Martini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-11 00:00:00.000000000 Z
11
+ date: 2024-08-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A gem to calculate the XIRR using a C extension for performance.
14
14
  email: