aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-05-11 20:50:06 +0200
committerMattias Andrée <maandree@kth.se>2016-05-11 20:50:06 +0200
commit626dc2a770207bc1398214e040166f58ec9b8df4 (patch)
tree17cf35d329e114741e2788b1d2fe99e09f34401c /doc
parentMinor edit in Addition (diff)
downloadlibzahl-626dc2a770207bc1398214e040166f58ec9b8df4.tar.gz
libzahl-626dc2a770207bc1398214e040166f58ec9b8df4.tar.bz2
libzahl-626dc2a770207bc1398214e040166f58ec9b8df4.tar.xz
Manual: use inplace addition whenever possible
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--doc/arithmetic.tex17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/arithmetic.tex b/doc/arithmetic.tex
index 713eedc..f16f04f 100644
--- a/doc/arithmetic.tex
+++ b/doc/arithmetic.tex
@@ -87,6 +87,23 @@ is however not implemented because it is
not deemed important enough and would
be detrimental to libzahl's simplicity.
+{\tt zadd} and {\tt zadd\_unsigned} support
+in-place operation:
+
+\begin{alltt}
+ zadd(a, a, b);
+ zadd(b, a, b); \textcolor{c}{/* \textrm{should be avoided} */}
+ zadd_unsigned(a, a, b);
+ zadd_unsigned(b, a, b); \textcolor{c}{/* \textrm{should be avoided} */}
+\end{alltt}
+
+\noindent
+Use this whenever possible, it will improve
+your performance, as it will involve less
+CPU instructions for each character-addition
+and it may be possible to elementation some
+character-additions.
+
\newpage
\section{Subtraction}