exonio 0.5.3 → 0.5.4

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
- SHA1:
3
- metadata.gz: 089644ebee28aed7078f0c5ed6c0c28e8ef58e6c
4
- data.tar.gz: 994f36751c19bb074d6b47fe10fbc4f477321b3f
2
+ SHA256:
3
+ metadata.gz: 2177008fa8ad1fce23bd78efe356f146ab94350acb804eacc6fbdf7cf0b73756
4
+ data.tar.gz: a8a144747cec2755ae8c6739b91b8a4cc8eee4630ac6c950147c2eca260d5711
5
5
  SHA512:
6
- metadata.gz: a5c946611830bb1de45b3933f4a7e78e6e8ef253e2e204f3ce0969f6cd5f55d271833f80cf1e71c934c0b37d0b8722f8fabedc4ad511cdfd9b66115586c78048
7
- data.tar.gz: c1ee25b9476757738c18e4c2e7220edd4b214bf9a803727385284b1a8ae3473c63fce51b3e1e2374d25b26fd6e01721d257639502f1976dc54c061fd9e6c4dbf
6
+ metadata.gz: 74c8699b45184bcee100bda0aacf58f526461a02f4904e728ab9d1c2f4c3822a30fd19ea5fdff3de8c7f325eded5428e0946e2f243d15515c008181958404052
7
+ data.tar.gz: 170be11052472cdc4ed37f11bd6821a5f3273b44fd3e8374a52502918bb6d84a67f2c6e4483d35626533851852abee7e2426d04dfc1d89dbd00331d4a16c9131
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.5.4
4
+
5
+ * Fix zero interest rate (#18)
6
+ * Remove BigDecimal.new deprecation warning (#17)
7
+
3
8
  ## 0.5.3
4
9
 
5
10
  * Fix error on IRR function
@@ -1,37 +1,35 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- exonio (0.5.3)
4
+ exonio (0.5.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- byebug (8.2.1)
10
- coderay (1.1.0)
11
- diff-lcs (1.2.5)
12
- method_source (0.8.2)
13
- pry (0.10.3)
14
- coderay (~> 1.1.0)
15
- method_source (~> 0.8.1)
16
- slop (~> 3.4)
9
+ byebug (8.2.5)
10
+ coderay (1.1.2)
11
+ diff-lcs (1.3)
12
+ method_source (1.0.0)
13
+ pry (0.13.1)
14
+ coderay (~> 1.1)
15
+ method_source (~> 1.0)
17
16
  pry-byebug (3.3.0)
18
17
  byebug (~> 8.0)
19
18
  pry (~> 0.10)
20
- rake (10.5.0)
21
- rspec (3.4.0)
22
- rspec-core (~> 3.4.0)
23
- rspec-expectations (~> 3.4.0)
24
- rspec-mocks (~> 3.4.0)
25
- rspec-core (3.4.1)
26
- rspec-support (~> 3.4.0)
27
- rspec-expectations (3.4.0)
19
+ rake (13.0.1)
20
+ rspec (3.9.0)
21
+ rspec-core (~> 3.9.0)
22
+ rspec-expectations (~> 3.9.0)
23
+ rspec-mocks (~> 3.9.0)
24
+ rspec-core (3.9.2)
25
+ rspec-support (~> 3.9.3)
26
+ rspec-expectations (3.9.2)
28
27
  diff-lcs (>= 1.2.0, < 2.0)
29
- rspec-support (~> 3.4.0)
30
- rspec-mocks (3.4.1)
28
+ rspec-support (~> 3.9.0)
29
+ rspec-mocks (3.9.1)
31
30
  diff-lcs (>= 1.2.0, < 2.0)
32
- rspec-support (~> 3.4.0)
33
- rspec-support (3.4.1)
34
- slop (3.6.0)
31
+ rspec-support (~> 3.9.0)
32
+ rspec-support (3.9.3)
35
33
 
36
34
  PLATFORMS
37
35
  ruby
@@ -40,8 +38,8 @@ DEPENDENCIES
40
38
  bundler (~> 1.11)
41
39
  exonio!
42
40
  pry-byebug (~> 3.3.0)
43
- rake (~> 10.0)
41
+ rake (~> 13.0)
44
42
  rspec (~> 3.0)
45
43
 
46
44
  BUNDLED WITH
47
- 1.16.4
45
+ 1.17.2
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.11"
22
- spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency "rake", "~> 13.0"
23
23
  spec.add_development_dependency "rspec", "~> 3.0"
24
24
  spec.add_development_dependency "pry-byebug", "~> 3.3.0"
25
25
  end
@@ -50,8 +50,8 @@ module Exonio
50
50
  # constant-amount periodic payments and a constant interest rate.
51
51
  #
52
52
  # @param rate [Float] The interest rate as decimal (not per cent) per period
53
- # @param pmt [Float] The number of payments to be made
54
- # @param pv [Float] The present value
53
+ # @param pmt [Float] The payment amount made each period
54
+ # @param pv [Float] The present value of the payments
55
55
  # @param fv [Float] The future value remaining after the final payment has been made
56
56
  # @param end_or_begining [Integer] Whether payments are due at the end (0) or
57
57
  # beggining (1) of each period
@@ -62,6 +62,8 @@ module Exonio
62
62
  # Exonio.nper(0.07 / 12, -150, 8000) # ==> 64.07334877066185
63
63
  #
64
64
  def nper(rate, pmt, pv, fv = 0, end_or_beginning = 0)
65
+ return (-pv - fv) / pmt if rate.zero?
66
+
65
67
  z = pmt * (1 + rate * end_or_beginning) / rate
66
68
  temp = Math.log((-fv + z) / (pv + z))
67
69
 
@@ -11,7 +11,7 @@ module Exonio
11
11
 
12
12
  values.each do |key, value|
13
13
  define_method key do
14
- BigDecimal.new(value)
14
+ BigDecimal(value)
15
15
  end
16
16
  end
17
17
 
@@ -1,3 +1,3 @@
1
1
  module Exonio
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exonio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Izidoro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-29 00:00:00.000000000 Z
11
+ date: 2020-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -109,8 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []
112
- rubyforge_project:
113
- rubygems_version: 2.5.1
112
+ rubygems_version: 3.0.3
114
113
  signing_key:
115
114
  specification_version: 4
116
115
  summary: Excel usefull formulas written in Ruby