exonio 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c634f17bc1a7424b3be9e782fb72a8e226c4dd09a7b37d0dc71f026c2909b71
4
- data.tar.gz: aa306d1c5dd6de8e32c06916057986291e551779293ceeed832100eacddf7c5b
3
+ metadata.gz: d9378589552d7f80a4b46042b0a0a55dc84e79d65484f53381a8d534b20186dc
4
+ data.tar.gz: 91ca4fd17ff38669d5c8284f377fabae0d689ce24e489fa391032815d926c33f
5
5
  SHA512:
6
- metadata.gz: 33ae1525fa62badfdc56d8203f4eab2d762f5284e4b4996b25b8a447c16f70c8beae9946137a03104e8c68c4c0c7131a70fc673fb26328faf9b74e2a42cc8035
7
- data.tar.gz: e6b5907b0f28a7d235d462bbe3861398669d7339e0d77d0b3700cd906628a9d53660c51d5341915206bd6a32bc7dbbeec656e2ddfe4eb78d977914f3e8191496
6
+ metadata.gz: 3b89195bd85a1fb68a01db4cfbedb845e1b15a3dcdcdf8099fd8bd74f5d782f7e2ebaf538221d467c87b193f2389f1225a41e1b2dfb60e23ffd8d0d428875cb6
7
+ data.tar.gz: 295d2b187c08d1a65a6533293756f73635ed6457ba57895f220b6b845cd38601d812dde4fdc056bc6330e295d0eecdf816a8ddf0f6959dcbbe2dbbf0fb5a8cc8
@@ -8,15 +8,17 @@ on:
8
8
  jobs:
9
9
  test:
10
10
  strategy:
11
+ fail-fast: false
11
12
  matrix:
12
13
  os: [ubuntu-latest, macos-latest]
13
- ruby: ["2.3.1", "2.7", "3.0", "3.1"]
14
+ ruby: ["2.3.1", "2.7", "3.0", "3.1", "3.2"]
14
15
 
15
16
  runs-on: ${{ matrix.os }}
16
17
 
17
18
  steps:
18
19
  - uses: actions/checkout@v3
19
-
20
+ - name: Remove Gemfile.lock
21
+ run: rm Gemfile.lock
20
22
  - name: Set up Ruby
21
23
  uses: ruby/setup-ruby@v1
22
24
  with:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.7.0
4
+
5
+ * Implements `nominal` method (#35)
6
+ * Update dependencies (#32)
7
+
3
8
  ## 0.6.1
4
9
 
5
10
  * Update dependencies (#25)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- exonio (0.6.1)
4
+ exonio (0.7.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -17,25 +17,24 @@ GEM
17
17
  byebug (~> 8.0)
18
18
  pry (~> 0.10)
19
19
  rake (13.0.6)
20
- rspec (3.11.0)
21
- rspec-core (~> 3.11.0)
22
- rspec-expectations (~> 3.11.0)
23
- rspec-mocks (~> 3.11.0)
24
- rspec-core (3.11.0)
25
- rspec-support (~> 3.11.0)
26
- rspec-expectations (3.11.0)
20
+ rspec (3.12.0)
21
+ rspec-core (~> 3.12.0)
22
+ rspec-expectations (~> 3.12.0)
23
+ rspec-mocks (~> 3.12.0)
24
+ rspec-core (3.12.0)
25
+ rspec-support (~> 3.12.0)
26
+ rspec-expectations (3.12.0)
27
27
  diff-lcs (>= 1.2.0, < 2.0)
28
- rspec-support (~> 3.11.0)
29
- rspec-mocks (3.11.1)
28
+ rspec-support (~> 3.12.0)
29
+ rspec-mocks (3.12.0)
30
30
  diff-lcs (>= 1.2.0, < 2.0)
31
- rspec-support (~> 3.11.0)
32
- rspec-support (3.11.0)
31
+ rspec-support (~> 3.12.0)
32
+ rspec-support (3.12.0)
33
33
 
34
34
  PLATFORMS
35
35
  ruby
36
36
 
37
37
  DEPENDENCIES
38
- bundler (~> 1.11)
39
38
  exonio!
40
39
  pry-byebug (~> 3.3.0)
41
40
  rake (~> 13.0)
data/README.md CHANGED
@@ -34,7 +34,7 @@ To use Exonio you just have to call the method you like to use. Example:
34
34
 
35
35
  ### EFFECT
36
36
 
37
- The Excel EFFECT function returns the effective annual interest rate, given a nominal interest rate and the number of compounding periods per year.
37
+ The Excel EFFECT function returns the effective annual interest rate, given a nominal interest rate and the number of compounding periods per year.
38
38
  Effective annual interest rate is the interest rate actually earned due to compounding.
39
39
  More about this function [EFFECT](https://exceljet.net/excel-functions/excel-effect-function)
40
40
 
@@ -42,6 +42,15 @@ More about this function [EFFECT](https://exceljet.net/excel-functions/excel-eff
42
42
  Exonio.effect(0.05, 10 * 12) # ==> 0.05126014873337037
43
43
  ```
44
44
 
45
+ ### NOMINAL
46
+
47
+ The Excel NOMINAL function returns the nominal interest rate when given an effective annual interest rate and the number of compounding periods per year. The effective rate is the actual rate due to compounding. The nominal rate is typically the stated rate.
48
+ More about this function [NOMINAL](https://exceljet.net/functions/nominal-function)
49
+
50
+ ```ruby
51
+ Exonio.nominal(0.05, 12 / 6) # ==> 0.04939015319191986
52
+ ```
53
+
45
54
  ### FV
46
55
 
47
56
  What is the future value after 10 years of saving $100 now, with
data/exonio.gemspec CHANGED
@@ -18,7 +18,6 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.11"
22
21
  spec.add_development_dependency "rake", "~> 13.0"
23
22
  spec.add_development_dependency "rspec", "~> 3.0"
24
23
  spec.add_development_dependency "pry-byebug", "~> 3.3.0"
@@ -17,6 +17,22 @@ module Exonio
17
17
  (1 + rate / nper) ** nper - 1
18
18
  end
19
19
 
20
+ # Calculates the nominal interest rate when given an effective annual interest rate and the number of compounding periods per year.
21
+ # The effective rate is the actual rate due to compounding. The nominal rate is typically the stated rate.
22
+ #
23
+ # @param rate [Float] The effective annual interest rate as decimal (not per cent).
24
+ # @param npery [Integer] Number of compounding periods per year.
25
+ #
26
+ # @return [Float]
27
+ #
28
+ # @example
29
+ # Exonio.nominal(0.05, 12 / 2) # ==> 0.04939015319191986
30
+ #
31
+ def nominal(rate, npery)
32
+ npery * ((1 + rate)**(1.0/npery) - 1)
33
+ end
34
+
35
+
20
36
  # Calculates the future value of an annuity investment based on
21
37
  # constant-amount periodic payments and a constant interest rate.
22
38
  #
@@ -1,3 +1,3 @@
1
1
  module Exonio
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exonio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Izidoro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-25 00:00:00.000000000 Z
11
+ date: 2023-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.11'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.11'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: rake
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
95
  - !ruby/object:Gem::Version
110
96
  version: '0'
111
97
  requirements: []
112
- rubygems_version: 3.3.7
98
+ rubygems_version: 3.3.26
113
99
  signing_key:
114
100
  specification_version: 4
115
101
  summary: Excel usefull formulas written in Ruby