Floating Point Numbers

floating-point, python

Solution

Basically, the computer's floating point calculations have rounding errors. So if you perform `1.*1000./1000.`, you can end up with `1.0000004` or something like that. It is what the computer stores in the memory. However, you probably don't want to see 1.0000004 as a result of that calculation. So when you print the result, the computer does the rounding, and you will get simply `1`. But you have to know that it is not the real value in the computer's memory - it is only a comfortable visualization of your actual floating point number.

Problem

So I am reading this PDF tutorial called: "Learning Python Fourth Edition". Now I got to a part which I dont understand because I am pretty much a beginner in Python. I am talking about this part: Now I dont get the explaining of the first example. It does say: `It turns out that there are two ways to print every object: with full precision(as in the first result shown here)` but how is this `with full precision`? It might just explain it very easily for python programmers in the text but I dont seem to get it.

Original source

Related problems