aboutsummaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-03-01 15:59:13 +0100
committerMattias Andrée <maandree@kth.se>2016-03-01 15:59:13 +0100
commit048423f63eb16183b62f7621cc5bdc78adf9c859 (patch)
treec8bf712c6e700251235507e50288ab2106e8d5e9 /man
parentAdd more man pages (diff)
downloadlibzahl-048423f63eb16183b62f7621cc5bdc78adf9c859.tar.gz
libzahl-048423f63eb16183b62f7621cc5bdc78adf9c859.tar.bz2
libzahl-048423f63eb16183b62f7621cc5bdc78adf9c859.tar.xz
Man pages: rationale for non-essential arithmetic functions
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'man')
-rw-r--r--man/zdivmod.34
-rw-r--r--man/zmodmul.34
-rw-r--r--man/zmodpow.34
-rw-r--r--man/zsplit.33
-rw-r--r--man/zsqr.34
5 files changed, 19 insertions, 0 deletions
diff --git a/man/zdivmod.3 b/man/zdivmod.3
index 683d17f..b11b8b6 100644
--- a/man/zdivmod.3
+++ b/man/zdivmod.3
@@ -38,6 +38,10 @@ except it is
safe to call
.B zdivmod with
.IR "(quotient==remainder)" .
+.SH RATIONALE
+Calculating the remainder requires calculating division to
+be performed, and performing a division gives the remainder
+for free. It is often useful to calculate both.
.SH SEE ALSO
.BR zstr (3),
.BR zadd (3),
diff --git a/man/zmodmul.3 b/man/zmodmul.3
index 45fdbe9..e27f37c 100644
--- a/man/zmodmul.3
+++ b/man/zmodmul.3
@@ -29,6 +29,10 @@ Mod
It is safe to call
.B zmodmul
with non-unique parameters.
+.SH RATIONALE
+It is possible to calculate the modular product
+with a faster algorithm than calculating the
+product and than the modulus of that product.
.SH SEE ALSO
.BR zmodpow (3),
.BR zstr (3),
diff --git a/man/zmodpow.3 b/man/zmodpow.3
index 6e4f697..13b6082 100644
--- a/man/zmodpow.3
+++ b/man/zmodpow.3
@@ -29,6 +29,10 @@ Mod
It is safe to call
.B zmodpow
with non-unique parameters.
+.SH RATIONALE
+It is possible to calculate the modular power
+with a faster algorithm than calculating the
+power and than the modulus of that power.
.SH SEE ALSO
.BR zmodmul (3),
.BR zsqr (3),
diff --git a/man/zsplit.3 b/man/zsplit.3
index c666e52..5f83b8c 100644
--- a/man/zsplit.3
+++ b/man/zsplit.3
@@ -30,6 +30,9 @@ with
.I "(high==a)"
and
.IR "(low==a)" .
+.SH RATIONALE
+Splitting big integers in the described way is useful
+for divide-and-conquer algorithms.
.SH SEE ALSO
.BR zand (3),
.BR zor (3),
diff --git a/man/zsqr.3 b/man/zsqr.3
index 259f4ac..7974fa6 100644
--- a/man/zsqr.3
+++ b/man/zsqr.3
@@ -21,6 +21,10 @@ gets
It is safe to call
.B zsqr
with non-unique parameters.
+.SH RATIONALE
+Multiplication algorithm can be optimised if
+we know that the multiplier and the multiplicand
+are equal.
.SH SEE ALSO
.BR zmodmul (3),
.BR zmodpow (3),