>With ANY decimal numbers you will have some rounding errors. Sometimes the programs masks the error, and you get the result you want, and sometimes you get the wrong value, there's simply no way to avoid that.
Not quite correct. The following set of decimals (plus any integer part) has an exact representation in binary: 0.5, 0.25, 0.75, 0.125, 0.375, 0.625, 0.875, ... i.e. those that can be expressed as m/2**n.