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 +4 -4
- data/ext/fast_xirr/common.c +2 -3
- data/lib/fast_xirr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4836e4f3499607c058d627e0718c1415bc7bfd23f750f9df413dc6c4527ee6a7
|
4
|
+
data.tar.gz: 9331bdb84b707c270c5e29d914dd9e6eeb814d102a1e0b3a25322e3e67435c73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e130e92d55d75e71b706ece17b6318c36924c69aae09b1b34320369a912b2ead4dc76caded2446ebe93389a3f6db9a55f65979a108a68feefadfe1511b87b39f
|
7
|
+
data.tar.gz: fed653b1893283b35d72846300995bee86e7fb452fcb66cda23d2285bcf97fda3b99c7c2a83719ed275336944e7aed712051b1d6f2031db64624705ef35256b7
|
data/ext/fast_xirr/common.c
CHANGED
@@ -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
|
-
|
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
|
74
|
+
*low = rate / 1.5;
|
76
75
|
*high = rate;
|
77
76
|
return 1;
|
78
77
|
}
|
data/lib/fast_xirr/version.rb
CHANGED
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.
|
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-
|
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:
|