Skip to content

Commit f6fc03c

Browse files
committed
small improvements and typos fixed
1 parent 62b4e1b commit f6fc03c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

text/main/classes/basics/basics.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,11 @@
456456
Usually, that itself is totally fine:
457457
There are only very few application were we really need more than 15 digits of precision.
458458
Still, let's continue this example for a bit.
459-
What happens if we try to compute~$10^{18}+1$ and then subtract~$10^{18}$ from this sum?
459+
What happens if we try to compute~$10^{16}+1$ and then subtract~$10^{16}$ from this sum?
460460
Obviously, in an ideal world, the result should be~\pythonil{1.0}.
461461
While \pythonil{1e16 + 1} would be \pythonil{10_000_000_000_000_001.0} which does not fit in a \pythonil{float}, \pythonil{1.0}~is a number that we can correctly and accurately represent as a~\pythonilIdx{float}.
462462
The actual result of this computation in \python, however, is~\pythonil{0.0}.
463-
The reason is that the result of the intermediate computation of \pythonil{1e18 + 1 == 1e18} and then \pythonil{1e18 - 1e18 == 0}.
463+
The reason is that the result of the intermediate computation of \pythonil{1e16 + 1 == 1e16} and then \pythonil{1e16 - 1e16 == 0}.
464464

465465
Similarly, computing \pythonil{1e18 + 1 + 1e36 - 1e36 - 1e18} yields~\pythonil{-1e18}, while the \inQuotes{correct} result would again be~\pythonil{1.0}.
466466
The reason is that first, \pythonil{1e18 + 1 == 1e18} is computed.

0 commit comments

Comments
 (0)