title: What's wrong with my change calculator?
body: <pre><code>puts "Welcome to the change calculator. Give me a dollar value, and I will give you the least number of coins equal to that amount."
  dollar = gets.to_f
  quarters = dollar / 0.25
  remains1 = dollar % 0.25
  dimes = remains1 / 0.10
  remains2 = remains1 % 0.10
  nickels = remains2 / 0.05
  remains3 = remains2 % 0.05
  pennies = remains3 / 0.01
  puts "Your change is #{quarters.to_i} Quarters, #{dimes.to_i} Dimes, #{nickels.to_i} Nickels, and #{pennies.to_i} Pennies."
  </code></pre>
  
  <p>It should give the change in coins, but something is wrong with the rounding. For example, when I put in $ 2.32 it outputs "Your change is 9 Quarters, 0 Dimes, 1 Nickels, and 1 Pennies." It should be 2 pennies. What's wrong?</p>