that is more digits than most people find usefulso python keeps the number of digits manageable by displaying rounded value instead just remembereven though the printed result looks like the exact value of / the actual stored value is the nearest representable binary fraction interestinglythere are many different decimal numbers that share the same nearest approximate binary fraction for examplethe numbers and and are all approximated by * since all of these decimal values share the same approximationany one of them could be displayed while still preserving the invariant eval(repr( )= historicallythe python prompt and built-in repr(function would choose the one with significant digits starting with python python (on most systemsis now able to choose the shortest of these and simply display note that this is in the very nature of binary floating-pointthis is not bug in pythonand it is not bug in your code either you'll see the same kind of thing in all languages that support your hardware' floating-point arithmetic (although some languages may not display the difference by defaultor in all output modesfor more pleasant outputyou may wish to use string formatting to produce limited number of significant digitsformat(math pi '' give significant digits format(math pi '' give digits after the point repr(math pi' it' important to realize that this isin real sensean illusionyou're simply rounding the display of the true machine value one illusion may beget another for examplesince is not exactly / summing three values of may not yield exactly either = false alsosince the cannot get any closer to the exact value of / and cannot get any closer to the exact value of / then pre-rounding with round(function cannot helpround round round =round false though the numbers cannot be made closer to their intended exact valuesthe round(function can be useful for post-rounding so that results with inexact values become comparable to one anotherround =round true floating point arithmeticissues and limitations