Last active
October 15, 2015 12:40
-
-
Save b1nary/2aea768df61a03a345b6 to your computer and use it in GitHub Desktop.
LOAN?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
INPUT = 1.0 | |
RATE = 0.000355 | |
DAYS = [1, 2, 3, 7, 14, 30, 60, 90, 180, 364] | |
DAYS.each do |days| | |
out = INPUT | |
days.times do |i| | |
out += out*RATE | |
end | |
puts "[#{days}]\tIN #{INPUT} / OUT #{'%.8f' % out} : +#{'%.8f' % ((out/(INPUT/100))-100)} %" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] IN 1.0 / OUT 1.00035500 : +0.03550000 % | |
[2] IN 1.0 / OUT 1.00071013 : +0.07101260 % | |
[3] IN 1.0 / OUT 1.00106538 : +0.10653781 % | |
[7] IN 1.0 / OUT 1.00248765 : +0.24876481 % | |
[14] IN 1.0 / OUT 1.00498148 : +0.49814846 % | |
[30] IN 1.0 / OUT 1.01070500 : +1.07050030 % | |
[60] IN 1.0 / OUT 1.02152460 : +2.15246030 % | |
[90] IN 1.0 / OUT 1.03246003 : +3.24600269 % | |
[180] IN 1.0 / OUT 1.06597371 : +6.59737071 % | |
[364] IN 1.0 / OUT 1.13791435 : +13.79143496 % |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment