fifteen floating point arithmeticissues and limitations floating-point numbers are represented in computer hardware as base (binaryfractions for examplethe decimal fraction has value / / / and in the same way the binary fraction has value / / / these two fractions have identical valuesthe only real difference being that the first is written in base fractional notationand the second in base unfortunatelymost decimal fractions cannot be represented exactly as binary fractions consequence is thatin generalthe decimal floating-point numbers you enter are only approximated by the binary floatingpoint numbers actually stored in the machine the problem is easier to understand at first in base consider the fraction / you can approximate that as base fraction orbetter orbetter and so on no matter how many digits you're willing to write downthe result will never be exactly / but will be an increasingly better approximation of / in the same wayno matter how many base digits you're willing to usethe decimal value cannot be represented exactly as base fraction in base / is the infinitely repeating fraction stop at any finite number of bitsand you get an approximation on most machines todayfloats are approximated using binary fraction with the numerator using the first bits starting with the most significant bit and with the denominator as power of two in the case of / the binary fraction is * which is close to but not exactly equal to the true value of / many users are not aware of the approximation because of the way values are displayed python only prints decimal approximation to the true decimal value of the binary approximation stored by the machine on most machinesif python were to print the true decimal value of the binary approximation stored for it would have to display