commit c1b7101b0f33b07c98b971b2dd075c068f319299
Author: Mattias Andrée <[email protected]>
AuthorDate: Mon Mar 7 07:36:29 2016 +0100
Commit: Mattias Andrée <[email protected]>
CommitDate: Mon Mar 7 07:36:29 2016 +0100
A brief description of exponentiation by squaring
Signed-off-by: Mattias Andrée <[email protected]>
diff --git a/src/zpow.c b/src/zpow.c
index 7388bde..f709ff9 100644
--- a/src/zpow.c
+++ b/src/zpow.c
@@ -8,6 +8,12 @@
void
zpow(z_t a, z_t b, z_t c)
{
+ /*
+ * Exponentiation by squaring.
+ *
+ * 7â19 = 7â10011â = 7â2â° â
7â2¹ â
7â2â´ where
aâ2â(n + 1) = (aâ2ân)².
+ */
+
size_t i, j, n, bits;
zahl_char_t x;