aboutsummaryrefslogtreecommitdiffstats
path: root/doc/exercises.tex
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-25 17:08:51 +0200
committerMattias Andrée <maandree@kth.se>2016-07-25 17:08:51 +0200
commitfaaa7dc980a80895b703775d18132eb6db105021 (patch)
tree4289df39047cb07a3b0ef2adaa09936ff9612385 /doc/exercises.tex
parentManual refdup should not return int (diff)
downloadlibzahl-faaa7dc980a80895b703775d18132eb6db105021.tar.gz
libzahl-faaa7dc980a80895b703775d18132eb6db105021.tar.bz2
libzahl-faaa7dc980a80895b703775d18132eb6db105021.tar.xz
Exercise solutions: the return type should be on the line above the function name, like in the rest of the manual
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--doc/exercises.tex12
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/exercises.tex b/doc/exercises.tex
index 160067d..e004f0a 100644
--- a/doc/exercises.tex
+++ b/doc/exercises.tex
@@ -336,7 +336,8 @@ $2^p \equiv 2 ~(\text{Mod}~p)$. This gives us
\vspace{-1em}
\begin{alltt}
-enum zprimality ptest_fast(z_t p)
+enum zprimality
+ptest_fast(z_t p)
\{
z_t a;
int c = zcmpu(p, 2);
@@ -363,7 +364,8 @@ such that $1 < a < p$) if $t < 0$.
\vspace{-1em}
\begin{alltt}
-enum zprimality ptest_fermat(z_t witness, z_t p, int t)
+enum zprimality
+ptest_fermat(z_t witness, z_t p, int t)
\{
enum zprimality rc = PROBABLY_PRIME;
z_t a, p1, p3, temp;
@@ -405,7 +407,8 @@ enum zprimality ptest_fermat(z_t witness, z_t p, int t)
\vspace{-1em}
\begin{alltt}
-enum zprimality ptest_llt(z_t n)
+enum zprimality
+ptest_llt(z_t n)
\{
z_t s, M;
int c;
@@ -505,7 +508,8 @@ but for efficiency and briefness, we will use
\vspace{-1em}
\begin{alltt}
-void golden_pow(z_t r, z_t n)
+void
+golden_pow(z_t r, z_t n)
\{
if (zsignum(n) <= 0)
zsetu(r, zcmpi(n, -1) >= 0);