libzahl

big integer library
git clone git://git.suckless.org/libzahl
Log | Files | Refs | README | LICENSE

commit d714b7adc9fc6f52feaedd12d41cd4bedb51698f
parent 813c362c7e1bbcc503d2bf62275bd304d0943d44
Author: Mattias Andrée <maandree@kth.se>
Date:   Mon,  9 May 2016 21:38:13 +0200

Some small changes and additions to the manual

Signed-off-by: Mattias Andrée <maandree@kth.se>

Diffstat:
Mdoc/libzahls-design.tex | 24+++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/doc/libzahls-design.tex b/doc/libzahls-design.tex @@ -109,7 +109,7 @@ The data type used to represent a big integer with libzahl is {\tt z\_t},\footnote{This name actually violates the naming convention; it should be {\tt Z}, or {\tt Zahl} to avoid single-letter names. But this -violation is common place.} defined as +violation is common-place.} defined as \begin{alltt} typedef struct zahl z_t[1]; @@ -144,14 +144,14 @@ As a user, try not to think about anything else than \noindent details can change in future versions of libzahl. -{\tt z\_t} is defined as a single-element array. -This is often called a reference. There are some -flexibility issues with this, why {\tt struct zahl} -has beed added, but for most uses with big integers, -it makes things simpler. Particularly, you need not -work prepend {\tt \&} to variable when making function -calls, but the existence of {\tt struct zahl} allows -you do so if you so choose. +{\tt z\_t} is defined as a single-element array. This +is often called a reference, or a call-by-reference. +There are some flexibility issues with this, why +{\tt struct zahl} has beed added, but for most uses +with big integers, it makes things simpler. Particularly, +you need not work prepend {\tt \&} to variable when making +function calls, but the existence of {\tt struct zahl} +allows you do so if you so choose. The {\tt .sign} member, is either $-1$, 0, or 1, when the integer is negative, zero, or positive, @@ -254,3 +254,9 @@ rather than \noindent This assumption is not made for non-commutative functions. + +When writting your own functions, be aware, +input-parameters are generally not declared {\tt const} +in libzahl. Currently, some functions actually make +modifications (that do not affect the value) to +input-parameters.