Due to the nature of floating path arithmetic, almost all floating point arithmetic is Computer arithmetic is often imprecise. The computer can only maintain a finite number of digits. Although floating point types can represent fractions, they are not immune to this limitation. As a result, it is impossible to precisely represent repeating binary-representation values, such as 1/3 or 1/5, in binary floating point.
When precise computations are necessary, consider alternative representations that may be able to completely represent your values. For example, if you are performing arithmetic on decimal values and need an exact decimal rounding mode based on decimal values, represent your the values in binary decimal instead of using floating point.
...