Skip to content

Commit ce3f81b

Browse files
committed
bool datatype added
1 parent 571182e commit ce3f81b

File tree

13 files changed

+387
-33
lines changed

13 files changed

+387
-33
lines changed

bibliography/bibliography.bib

Lines changed: 176 additions & 5 deletions
Large diffs are not rendered by default.

notation/software.sty

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ text={\softwareStyle{Linux}},%
1010
name={Linux},%
1111
sort={Linux},%
1212
description={%
13-
is the leading open source operating system, i.e., a free alternative for \windows~\cite{T1999TLE}. %
13+
is the leading open source operating system, i.e., a free alternative for \windows~\cite{T1999TLE,B2022ELATCL,H2022LML}. %
1414
Its variant \ubuntu\ is particularly easy to use and install. %
1515
We recommend using it for this course, for software development, and for research. %
1616
Learn more at \url{https://www.linux.org/}.%
@@ -24,7 +24,7 @@ text={\softwareStyle{Matplotlib}},%
2424
name={Matplotlib},%
2525
sort={Matplotlib},%
2626
description={%
27-
is a \python\ package for plotting diagrams and charts~\cite{H2007MA2GE}. %
27+
is a \python\ package for plotting diagrams and charts~\cite{H2007MA2GE,P2021HOMLPAVWP,J2018NPSCADSAWNSAM}. %
2828
Learn more at at \url{https://matplotlib.org}.%
2929
}%
3030
}%
@@ -47,7 +47,7 @@ text={\softwareStyle{NumPy}},%
4747
name={NumPy},%
4848
sort={NumPy},%
4949
description={%
50-
is a fundamental package for scientific computing with \python, which offers efficient array datastructures~\cite{HMvdWGVCWTBSKPHvKBHFdRWPGMSRWAGO2020APWN}. %
50+
is a fundamental package for scientific computing with \python, which offers efficient array datastructures~\cite{HMvdWGVCWTBSKPHvKBHFdRWPGMSRWAGO2020APWN,DBvR2024ITN,J2018NPSCADSAWNSAM}. %
5151
Learn more at \url{https://numpy.org/}.%
5252
}%
5353
}%
@@ -59,7 +59,7 @@ text={\softwareStyle{Pandas}},%
5959
name={Pandas},%
6060
sort={Pandas},%
6161
description={%
62-
is a \python\ data analysis and manipulation library~\cite{B2012DPWP}. %
62+
is a \python\ data analysis and manipulation library~\cite{B2012DPWP,L2024PW}. %
6363
Learn more at \url{https://pandas.pydata.org}.%
6464
}%
6565
}%
@@ -71,7 +71,7 @@ text={\softwareStyle{PyCharm}},%
7171
name={PyCharm},%
7272
sort={PyCharm},%
7373
description={%
74-
is the convenient \python\ \pgls{ide} that we recommend for this course~\cite{VHN2023HOADWP}. %
74+
is the convenient \python\ \pgls{ide} that we recommend for this course~\cite{VHN2023HOADWP,Y2022PPADT}. %
7575
Learn more at \url{https://www.jetbrains.com/pycharm}.%
7676
}%
7777
}%
@@ -91,11 +91,20 @@ Learn more at \url{https://python.org}.}
9191
\protected\gdef\pythonWithVersion{\softwareStyle{\python~\pythonVersion}}%
9292
%
9393
%
94+
\newglossaryentry{pytorch}{%
95+
text={\softwareStyle{PyTorch}},%
96+
name={PyTorch},%
97+
sort={PyTorch},%
98+
description={is a \python\ library for deep learning and \pgls{AI}~\cite{PGMLBCKLGADKYDRTCSFBC2019PAISHPDLL,RLM2022MLWPAS}. %
99+
Learn more at \url{https://pytorch.org}.}
100+
}%
101+
\protected\gdef\pytorch{\pgls{pytorch}}%
102+
%
94103
\newglossaryentry{scikitlearn}{%
95104
text={\softwareStyle{Scikit-learn}},%
96105
name={Scikit-learn},%
97106
sort={Scikit-learn},%
98-
description={is a \python\ library offering various machine learning tools~\cite{PVGMTGBPWDVPCBPD2011SMLIP}. %
107+
description={is a \python\ library offering various machine learning tools~\cite{PVGMTGBPWDVPCBPD2011SMLIP,RLM2022MLWPAS}. %
99108
Learn more at \url{https://scikit-learn.org}.}
100109
}%
101110
\protected\gdef\scikitlearn{\pgls{scikitlearn}}%
@@ -105,7 +114,7 @@ Learn more at \url{https://scikit-learn.org}.}
105114
text={\softwareStyle{SciPy}},%
106115
name={SciPy},%
107116
sort={SciPy},%
108-
description={is a \python\ library for scientific computing~\cite{VGOHRCBPWBvdWBWMMNJKLCPFMVLPCHQHARPvMS2020SFAFSCIP}. %
117+
description={is a \python\ library for scientific computing~\cite{VGOHRCBPWBvdWBWMMNJKLCPFMVLPCHQHARPvMS2020SFAFSCIP,J2018NPSCADSAWNSAM}. %
109118
Learn more at \url{https://scipy.org}.}
110119
}%
111120
\protected\gdef\scipy{\pgls{scipy}}%
@@ -126,7 +135,7 @@ Learn more at \url{https://simpy.readthedocs.io}.}
126135
text={\softwareStyle{TensorFlow}},%
127136
name={TensorFlow},%
128137
sort={TensorFlow},%
129-
description={is a \python\ library for implementing machine learning, especially suitable for training of neural networks~\cite{ABCCDDDGIIKLMMMSTVWWYZ2016TASFLSML}. %
138+
description={is a \python\ library for implementing machine learning, especially suitable for training of neural networks~\cite{ABCCDDDGIIKLMMMSTVWWYZ2016TASFLSML,L2023TDDBTADMLMWT}. %
130139
Learn more at \url{https://www.tensorflow.org}.}
131140
}%
132141
\protected\gdef\tensorflow{\pgls{tensorflow}}%

notation/terms.sty

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ This requires the root password.%
118118
name={terminal},%
119119
plural={terminals},%
120120
description={%
121-
A terminal is a text-based window where you can enter commands and execute them~\cite{CN2020ULB}. %
121+
A terminal is a text-based window where you can enter commands and execute them~\cite{CN2020ULB,B2022ELATCL}. %
122122
Knowing what a terminal is and how to use it is very essential in any programming- or system administration-related task. %
123123
If you want to open a terminal under \windows, you can \windowsTerminal, as shown, e.g., in \cpageref{fig:installingPythonWindows01openTerminal}. %
124124
Under \ubuntu\ \linux, \ubuntuTerminal\ opens a terminal.%

text/main/basics/gettingStarted/gettingStarted.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
In software development, you often work with a \pgls{VCS} like \git.
1414
You want to do that convenient from your editor.
1515
Such an editor, which integrates many of the common tasks that occur during programming, is called an \pgls{IDE}.
16-
In this book, we will use the \pycharm\ \pgls{IDE}~\cite{VHN2023HOADWP}.
16+
In this book, we will use the \pycharm\ \pgls{IDE}~\cite{VHN2023HOADWP,Y2022PPADT}.
1717
If you do not yet have \pycharm\ installed, then you can work through the setup instructions outlined in \cref{sec:installingPyCharm}.
1818

1919
Before we get into these necessary installation and setup steps that we need to really learn programming, we face a small problem:
2020
Today, devices with many different \pgls{OS} are available.
2121
For each \pgls{OS}, the installation steps and software availability may be different, so I cannot possibly cover them all.
22-
Personally, I strongly recommend using \linux~\cite{T1999TLE} for programming, work, and research.
22+
Personally, I strongly recommend using \linux~\cite{T1999TLE,B2022ELATCL,H2022LML} for programming, work, and research.
2323
If you are a student of computer science or any related field, then it is my personal opinion that you should get familiar with this operating system.
2424
Maybe you could start with the very easy-to-use \ubuntu\ \linux~\cite{CN2020ULB}.
2525
Either way, in the following, I will try to provide examples and instructions for both \ubuntu\ and the commercial Microsoft \windows~\cite{B2023W1IO} \pgls{OS}.

text/main/basics/gettingStarted/installingPython/pythonUnderUbuntu/pythonUnderUbuntu.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
%
1010
\begin{sloppypar}%
1111
Under \ubuntu\ \linux, \python~\softwareStyle{3} is already pre-installed.
12-
You can open a \pgls{terminal}, type \bashil{python3 --version}, hit \keys{\return}, and get the result illustrated in \cref{fig:ubuntuTerminalPythonVersion}:
12+
You can open a \pgls{terminal}~\cite{B2022ELATCL} by pressing~\ubuntuTerminal, then type in \bashil{python3 --version}, hit \keys{\return}, and get the result illustrated in \cref{fig:ubuntuTerminalPythonVersion}:
1313
\end{sloppypar}%
1414
%
1515
\endhsection%
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
\hsection{Boolean Values}%
2+
\label{sec:bool}%
3+
%
4+
Before, we already mentioned comparisons and their results, which can either be \pythonilIdx{True} or \pythonilIdx{False}.
5+
These two values constitute another basic datatype in \python: \pythonilIdx{bool}.
6+
They are fundamental for making decisions in a program, i.e., for deciding what to do based on data.
7+
%
8+
\hsection{Comparisons}%
9+
%
10+
\begin{figure}%
11+
\centering%
12+
\includegraphics[width=0.8\linewidth]{\currentDir/boolComparisons}%
13+
\caption{The results of basic comparisons are instances of \pythonilIdx{bool}.}%
14+
\label{fig:boolComparisons}%
15+
\end{figure}%
16+
%
17+
In the sections on \pythonilIdx{float}s and \pythonilIdx{int}s, we learned how to do arithmetics with real and integer numbers.
18+
You have learned these operations already in preschool.
19+
However, before you learn to calculate with numbers, you learned how to \emph{compare} them.
20+
If we compare two numbers, the result is either \pythonilIdx{True}, if the comparison works our positively, or \pythonilIdx{False}, if it does not.
21+
\python\ supports six types of comparison:%
22+
%
23+
\begin{itemize}%
24+
%
25+
\item equal: $a = b$ corresponds to \pythonil{a == b}\pythonIdx{==},%
26+
\item unequal: $a \neq b$ corresponds to \pythonil{a != b}\pythonIdx{!=},%
27+
\item less-than: $a < b$ corresponds to \pythonil{a < b}\pythonIdx{<},%
28+
\item less-than or equal: $a \leq b$ corresponds to \pythonil{a <= b}\pythonIdx{<=},%
29+
\item greater-than: $a > b$ corresponds to \pythonil{a > b}\pythonIdx{>}, and%
30+
\item greater-than or equal: $a \geq b$ corresponds to \pythonil{a >= b}\pythonIdx{>=}.%
31+
%
32+
\end{itemize}%
33+
%
34+
How to use these operators is illustrated in \cref{fig:boolComparisons}.
35+
It shows that \pythonil{6 == 6}\pythonIdx{==} yields \pythonilIdx{True}, while \pythonil{6 != 6}\pythonIdx{!=} yields \pythonilIdx{False}.
36+
The expression \pythonil{6 > 6}\pythonIdx{>} gives us \pythonilIdx{False}, but \pythonil{6 >= 6}\pythonIdx{>=} is \pythonilIdx{True}.
37+
\pythonil{6 < 6}\pythonIdx{<} is also \pythonilIdx{False} while \pythonil{6 <= 6} is, of course, \pythonilIdx{True}.
38+
While \pythonil{5 > 6}\pythonIdx{>} is not \pythonilIdx{True}, \pythonil{6 > 5}\pythonIdx{>} is.
39+
It is also possible to compare floating point numbers with integers and vice versa.
40+
\pythonil{5.5 == 5}\pythonIdx{==} is \pythonilIdx{False}, while \pythonilIdx{5.0 == 5} is \pythonilIdx{True}.
41+
42+
Comparisons can also be chained:
43+
\pythonil{3 < 4 < 5 < 6} is \pythonilIdx{True}, because \pythonil{3 < 4} and \pythonil{4 < 5} and \pythonil{5 < 6}.
44+
\pythonil{5 >= 4 > 4 >= 3}, however, is \pythonilIdx{False}, because while \pythonil{5 >= 4} and \pythonil{4 >= 3}, it is not true that \pythonil{4 > 4}.
45+
46+
If we check the type\pythonIdx{type} of \pythonilIdx{True}, it yields \pythonil{<class 'bool'>}, i.e., \pythonilIdx{bool}.
47+
The result of the expression \pythonil{5 == 5} is a \pythonilIdx{bool} as well.
48+
49+
When talking about comparisons, there is one important, counter-intuitive exception to recall:
50+
The \pythonilIdx{nan}\pythonIdx{Not a Number} floating point value\pythonIdx{float} from \cref{sec:float:special}.
51+
In \cref{fig:floatMathInConsoleNaN}, we learned that \pythonil{nan == nan}\pythonIdx{==} is \pythonilIdx{False} and \pythonil{nan != nan}\pythonIdx{!=} is \pythonilIdx{True}.
52+
This is the only primitive value (to my knowledge) which is not equal to itself.%
53+
\endhsection%
54+
%
55+
%
56+
\hsection{Boolean Operators}%
57+
%
58+
\begin{figure}%
59+
\centering%
60+
%
61+
\subfloat[][%
62+
The truth table for the logical conjunction (\emph{logical and}\pythonIdx{and}): \pythonil{a and b}.%
63+
\label{fig:booleanAnd}%
64+
]{%
65+
~~~~%
66+
\begin{tabular}{|c|c|c|}%
67+
\hline%
68+
\pythonil{a}&\pythonil{b}&\pythonil{a and b}\\%
69+
\hline%
70+
\pythonilIdx{False}&\pythonilIdx{False}&\pythonilIdx{False}\\%
71+
\hline%
72+
\pythonilIdx{False}&\pythonilIdx{True}&\pythonilIdx{False}\\%
73+
\hline%
74+
\pythonilIdx{True}&\pythonilIdx{False}&\pythonilIdx{False}\\%
75+
\hline%
76+
\pythonilIdx{True}&\pythonilIdx{True}&\pythonilIdx{True}\\%
77+
\hline%
78+
\end{tabular}%
79+
~~~~%
80+
}%
81+
%
82+
\strut\hfill\strut%
83+
%
84+
\subfloat[][%
85+
The truth table for the logical disjunction (\emph{logical or})\pythonIdx{or}: \pythonil{a or b}.%
86+
\label{fig:booleanOr}%
87+
]{%
88+
~~~~%
89+
\begin{tabular}{|c|c|c|}%
90+
\hline%
91+
\pythonil{a}&\pythonil{b}&\pythonil{a or b}\\
92+
\hline%
93+
\pythonilIdx{False}&\pythonilIdx{False}&\pythonilIdx{False}\\%
94+
\hline%
95+
\pythonilIdx{False}&\pythonilIdx{True}&\pythonilIdx{True}\\%
96+
\hline%
97+
\pythonilIdx{True}&\pythonilIdx{False}&\pythonilIdx{True}\\%
98+
\hline%
99+
\pythonilIdx{True}&\pythonilIdx{True}&\pythonilIdx{True}\\%
100+
\hline%
101+
\end{tabular}%
102+
~~~~%
103+
}%
104+
%
105+
\strut\hfill\strut%
106+
%
107+
\subfloat[][%
108+
The truth table for the logical negation (\emph{logical not}\pythonIdx{not}): \pythonil{not a}.%
109+
\label{fig:booleanNot}%
110+
]{%
111+
~~~~%
112+
\begin{tabular}{|c|c|}%
113+
\hline%
114+
\pythonil{a}&\pythonil{not a}\\%
115+
\hline%
116+
\pythonilIdx{False}&\pythonilIdx{True}\\%
117+
\hline%
118+
\pythonilIdx{True}&\pythonilIdx{False}\\%
119+
\hline%
120+
\end{tabular}%
121+
~~~~%
122+
}%
123+
%
124+
\caption{The truth tables for the Boolean operators \pythonilIdx{and}, \pythonilIdx{or}, and \pythonilIdx{not}.}%
125+
\label{fig:boolLogicTables}%
126+
\end{figure}%
127+
%
128+
\begin{figure}%
129+
\centering%
130+
\includegraphics[width=0.8\linewidth]{\currentDir/boolLogic}%
131+
\caption{The \pythonilIdx{bool} values can be combined with the Boolean logical operators \pythonilIdx{and}, \pythonilIdx{or}, and \pythonilIdx{not}.}%
132+
\label{fig:boolLogic}%
133+
\end{figure}%
134+
%
135+
The most common operations with Boolean values are the well-known Boolean logical operators \pythonilIdx{and}, \pythonilIdx{or}, and \pythonilIdx{not}.
136+
Their truth tables are illustrated in \cref{fig:boolLogicTables}.%
137+
%
138+
\begin{itemize}%
139+
%
140+
\item A Boolean conjunction, i.e., \pythonilIdx{and}, is \pythonilIdx{True} if and only both of its operands are also \pythonilIdx{True} and \pythonilIdx{False} otherwise, as shown in \cref{fig:booleanAnd}.%
141+
%
142+
\item A Boolean disjunction, i.e., \pythonilIdx{and}, is \pythonilIdx{True} if at least one of its two operands is \pythonilIdx{True} and \pythonilIdx{False} otherwise, as shown in \cref{fig:booleanOr}.%
143+
%
144+
\item The Boolean negation, i.e., \pythonilIdx{not}, is \pythonilIdx{True} if its operand is \pythonilIdx{False}. %
145+
Otherwise, it is \pythonilIdx{False}, as shown in \cref{fig:booleanNot}.%
146+
%
147+
\end{itemize}%
148+
%
149+
\begin{sloppypar}%
150+
In \cref{fig:boolLogic} we explore these three operators in the \python\ console.
151+
You can see that the operations can be used exactly as in the truth tables and yield the expected results.
152+
Additionally, you can of course nest and combine Boolean operators using parentheses\pythonIdx{(}\pythonIdx{)}.
153+
For example, \pythonil{(True or False) and ((False or True) or (False and False))} resolves to \pythonil{True and (True or False)}, which becomes \pythonil{True and True}, which ultimately becomes \pythonilIdx{True}.
154+
You can also combine Boolean expressions like comparisons using the logical operators:
155+
\pythonil{(5 < 4) or (6 < 9 < 8)} will be resolved to \pythonil{(False) or (False)}, which becomes \pythonilIdx{False}.%
156+
\end{sloppypar}%
157+
%
158+
\endhsection%
159+
%
160+
\hsection{Summary}%
161+
%
162+
Boolean values are very easy to understand and deal with.
163+
They can either be \pythonilIdx{True} or \pythonilIdx{False}.
164+
They can be combined using \pythonilIdx{and}, \pythonilIdx{or}, and \pythonilIdx{not}.
165+
And, finally, they are the results of comparison operators.
166+
Later, we will learn that Boolean decisions form the foundation for steering the control flow of programs.%
167+
%
168+
\endhsection%
169+
\endhsection%
170+
%
Binary file not shown.
Binary file not shown.

text/main/basics/simpleDataTypesAndOperations/float/float.tex

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
\hsection{Floating Point Numbers}%
2-
\label{sec:floats}%
2+
\label{sec:float}%
33
%
44
In the previous section, we have discussed integers in \python.
55
One of the very nice features of the \python~3 language is that integers can basically become arbitrarily large.
66
There is only the single type \pythonilIdx{int} and it can store any integer value, as long as the memory of our computer is large enough.%
77
%
88
\begin{sloppypar}%
9-
In an ideal world, we would have a similar feature also for fractional numbers.
9+
In an ideal world, we would have a similar feature also for real numbers.
1010
However, such a thing cannot be practically implemented.
1111
You will certainly remember the numbers $\pi\approx3.141\decSep592\decSep653\decSep590\dots$ and $e\approx2.718\decSep281\decSep828\decSep459\dots$ from highschool maths.
1212
They are transcendental~\cite{N1939TTOP,APM1991TOEAP,F2011TTOEAP}, i.e., their fractional digits never end and nobody has yet detected an orderly pattern in them.
@@ -28,7 +28,7 @@
2828
But how does it work in \python?
2929
How can we deal with the fact that we cannot dynamically represent fractional numbers exactly even in typical everyday cases?
3030
With \pythonilIdx{float}, \python\ offers us one type for fractional numbers.
31-
This datatype represents numbers usually in the same format as \pythonil{double}s in the \pgls{C}~programming language~\cite{PSF2024NTIFC}, which, in turn, internally have a 64~bit IEEE~Standard 754 floating point number layout~\cite{IEEE2019ISFFPA,H1997IS7FPN}.
31+
This datatype represents numbers usually in the same internal structure as \pythonil{double}s in the \pgls{C}~programming language~\cite{PSF2024NTIFC}, which, in turn, internally have a 64~bit IEEE~Standard 754 floating point number layout~\cite{IEEE2019ISFFPA,H1997IS7FPN}.
3232
The idea behind this standard is to represent both very large numbers, like~$10^{300}$ and very small numbers, like~$10^{-300}$.
3333
In order to achieve this, the 64~bits are divided into three pieces, as illustrated in \cref{fig:floatIEEEStructure}.
3434
%
@@ -105,7 +105,7 @@
105105
%
106106
\begin{sloppypar}%
107107
We can of course also write and compute more complex mathematical expressions.
108-
\pythonil{((3.4 * 5.5) - 1.2) ** (4.4 / 3.3)} corresponds to $((3.4*5.5)-1.2)^{\frac{4.4}{3.3}}$ and yields \pythonil{45.43432339119718}.
108+
\pythonil{((3.4 * 5.5) - 1.2) ** (4.4 / 3.3)}\pythonIdx{(}\pythonIdx{)} corresponds to $((3.4*5.5)-1.2)^{\frac{4.4}{3.3}}$ and yields \pythonil{45.43432339119718}.
109109
This is again not an exact value but a rounded value.
110110
We always need to keep this in mind.%
111111
\end{sloppypar}%
@@ -271,6 +271,7 @@
271271
\endhsection%
272272
%
273273
\hsection{Limits and Special Floating Point Values: Infinity and \inQuotes{Not a Number}}%
274+
\label{sec:float:special}%
274275
%
275276
\begin{figure}%
276277
\centering%
@@ -308,7 +309,9 @@
308309
\pythonil{2e-324} simply becomes \pythonilIdx{0.0}.
309310
This value is simply too small to be represented as a 64~bit / double precision IEEE~Standard 754 floating point number~\cite{IEEE2019ISFFPA,H1997IS7FPN}.
310311
The text \pythonil{2e-324} that we enter into the \python\ console will therefore be translated to the \pythonilIdx{float}~\pythonil{0.0}.
311-
The comparison \pythonil{2e-324 == 0.0}\pythonIdx{==} therefore results in \pythonilIdx{True}, while \pythonil{3e-324 == 0.0} is still \pythonilIdx{False}.
312+
The comparison \pythonil{2e-324 == 0.0}\pythonIdx{==} therefore results in \pythonilIdx{True}, while \pythonil{3e-324 == 0.0} is still \pythonilIdx{False}.\footnote{%
313+
See \cref{sec:bool} for more information on comparisons and the \pythonilIdx{bool} datatype with its values \pythonilIdx{True} and \pythonilIdx{False}.%
314+
}
312315
So we learned what happens if we try to define very small floating point numbers:
313316
They become zero.
314317

@@ -388,7 +391,7 @@
388391
In floating point mathematics, \pythonil{inf == inf} is \pythonilIdx{True} and \pythonil{inf != inf} is \pythonilIdx{False}\footnote{%
389392
Mathematicians may have mixed feelings about proclaiming that $\infty=\infty$ holds while $\infty-\infty$ is undefined\dots}.
390393
However, \pythonilIdx{nan} is \emph{really} different from really \emph{anything}.
391-
Therefore, \pythonil{nan == nan} is \pythonilIdx{False} and \pythonil{nan != nan} is \pythonilIdx{True}!
394+
Therefore, \pythonil{nan == nan}\pythonIdx{==} is \pythonilIdx{False} and \pythonil{nan != nan}\pythonIdx{!=} is \pythonilIdx{True}!
392395

393396
\begin{figure}%
394397
\centering%
@@ -425,7 +428,7 @@
425428
Thus, there is no way to exactly represent them in computer memory exactly.
426429
Another problem is that we may need both very large numbers like~$10^{300}$ and very small numbery like~$10^{-300}$.
427430

428-
Floating point numbers, provided as the \python\ datatype \pythonilIdx{float}, solve all of these problems (to some degree).
431+
Floating point numbers~\cite{G2023CAIP}, provided as the \python\ datatype \pythonilIdx{float}, solve all of these problems (to some degree).
429432
They offer a precision of about 15~digits for a wide range of large and small numbers.
430433
15~digits are more than enough for most applications.
431434
Many functions for floating point numbers, like logarithms and trigonometric functions, are offered by the \pythonilIdx{math} module.

0 commit comments

Comments
 (0)