RosettaCodeData/Task/Pathological-floating-point-problems/Ruby/pathological-floating-point-problems-2.rb
2023-07-01 13:44:08 -04:00

4 lines
149 B
Ruby

require 'bigdecimal/math'
balance = BigMath.E(50) - 1
1.upto(25){|y| balance = balance * y - 1}
puts "Bank balance after 25 years = #{balance.to_f}"