Weird problem with 36 and 39?
I am writing a small program for a school assignment that requests user input for the number of checks written per month. The program then multiplies that number by a per-check rate, which varies depending on the number of checks written, and adds in $10. While testing the program, I discovered that it works perfectly - unless I enter 36 or 39, or 48 or 52, which is when the math gets screwy. For example -
If I enter 34, I get 12.72; if I enter 35, I get 12.8 (another .08); but when I enter 36, I get 12.8799999; 37 gets me 12.96; 38 gets me 13.04; but then 39 gets me 13.1200001!
The .000001 that is missing from the answer for 36 comes out added to the answer for 39? This same anomaly occurs with 48 and 52.