libzahl

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

commit 048423f63eb16183b62f7621cc5bdc78adf9c859
parent 1f4fb92a5f52e25170f28a61e6979cf63ca7f36b
Author: Mattias Andrée <maandree@kth.se>
Date:   Tue,  1 Mar 2016 15:59:13 +0100

Man pages: rationale for non-essential arithmetic functions

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

Diffstat:
Mman/zdivmod.3 | 4++++
Mman/zmodmul.3 | 4++++
Mman/zmodpow.3 | 4++++
Mman/zsplit.3 | 3+++
Mman/zsqr.3 | 4++++
5 files changed, 19 insertions(+), 0 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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),