diff --git a/semester3/spca/parts/01_c/01_basics/02_declarations.tex b/semester3/spca/parts/01_c/01_basics/02_declarations.tex index 3736448..31c6224 100644 --- a/semester3/spca/parts/01_c/01_basics/02_declarations.tex +++ b/semester3/spca/parts/01_c/01_basics/02_declarations.tex @@ -83,8 +83,6 @@ in that they are passed by value and not by reference. You can of course pass it also by reference (like any other data type) by setting the argument to type \texttt{struct mystruct * name} and then calling the function using \texttt{func(\&test)} assuming \texttt{test} is the name of your struct -\newpage - \content{Typedef} To define a custom type using \texttt{typedef }. You may also use \texttt{typedef} on structs using \texttt{typedef struct }, diff --git a/semester3/spca/parts/01_c/01_basics/03_operators.tex b/semester3/spca/parts/01_c/01_basics/03_operators.tex index c1eb0ea..eb2222a 100644 --- a/semester3/spca/parts/01_c/01_basics/03_operators.tex +++ b/semester3/spca/parts/01_c/01_basics/03_operators.tex @@ -11,7 +11,7 @@ and it can also be used to do a sort-of assertion that we have an arithmetic typ which will cause a compiler error if \texttt{x} is for example a pointer. Of course, the lower precedence \verb|+| and \verb|-| is addition and subtraction, respectively. -Very low precedence belongs to boolean operators \verb|&&| and \texttt{||}, as well as the ternary operator and assignment operators +Very low precedence belongs to boolean operators \verb|&&| and \texttt{||}, as well as the ternary operator and assignment operators. \begin{table}[h!] \begin{tables}{ll}{Operator & Associativity} \texttt{() [] -> .} & Left-to-right \\ @@ -33,8 +33,8 @@ Very low precedence belongs to boolean operators \verb|&&| and \texttt{||}, as w \caption{\lC\ operators ordered in descending order by precedence} \label{tab:c-operators} \end{table} -In an expression like this -\mint{c}|(expr1, expr2)| + +In an expression like \texttt{x = (expr1, expr2)} the first expression is evaluated, its result is discarded, the second expression is executed and its result is returned. It is also possible to chain them, i.e. to use multiple without parenthesis, the last expression's value is ultimately returned. Of note is that the expressions have to be encased in parenthesis. diff --git a/semester3/spca/parts/01_c/06_floating-point/02_representation.tex b/semester3/spca/parts/01_c/06_floating-point/02_representation.tex index a95de24..91bd3e6 100644 --- a/semester3/spca/parts/01_c/06_floating-point/02_representation.tex +++ b/semester3/spca/parts/01_c/06_floating-point/02_representation.tex @@ -25,7 +25,8 @@ Single precision and Double precision floating point numbers store the $3$ param Bias: $1023$, Exponent range: $[-1022, 1023]$ \end{center} -Most of the extra precision in $64$b floating point numbers is associated to the mantissa. Note how double precision is necessary to represent all $32$b signed Integers, and not all $64$b signed Integers can be represented in either format. +Most of the extra precision in $64$b floating point numbers is associated to the mantissa. Note how double precision is necessary to represent all $32$b signed Integers, +and not all $64$b signed Integers can be represented in either format. \newpage @@ -33,7 +34,8 @@ The way these bitfields are interpretd \textit{differs} based on the exponent fi \begin{enumerate} \item \textbf{Normalized Values}: Exponent bit field $e$ is neither all $1$s nor all $0$s.\\ - In this case, $E$ is read in \textit{biased} form: $E = e - b$. The bias is $b=2^{k-1}-1$, where $k$ is the amount of bits reserved for $e$. This produces the exponent ranges $E \in [-(b-1), b]$.\\ + In this case, $E$ is read in \textit{biased} form: $E = e - b$. The bias is $b=2^{k-1}-1$, where $k$ is the number of bits reserved for $e$. + This produces the exponent ranges $E \in [-(b-1), b]$.\\ The mantissa field $m$ is interpreted as $M = 0.m_{n-1}\ldots m_1 m_0 + 1$, where $n$ is the amount of bits reserved for $m$ \item \textbf{Denormalized Values}: Exponent bit field $e$ is all $0$s.\\ In this case, $E$ is read in \textit{biased} form $E = 1 - b$. (Instead of $E = e - b$)\\ diff --git a/semester3/spca/spca-summary.pdf b/semester3/spca/spca-summary.pdf index 437ca11..755c1ce 100644 Binary files a/semester3/spca/spca-summary.pdf and b/semester3/spca/spca-summary.pdf differ