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;
 

Reply via email to