diff options
| author | Mattias Andrée <maandree@kth.se> | 2016-03-03 10:33:29 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2016-03-03 10:35:22 +0100 |
| commit | c0bc7b6e2d090554c9d940bc3614e089a688503a (patch) | |
| tree | a1b85a760ec1e18bdd0ceac15b802bdf6409e625 /src/zmodsqr.c | |
| parent | znot man page: notes on representation and tendness toward zero (diff) | |
| download | libzahl-c0bc7b6e2d090554c9d940bc3614e089a688503a.tar.gz libzahl-c0bc7b6e2d090554c9d940bc3614e089a688503a.tar.bz2 libzahl-c0bc7b6e2d090554c9d940bc3614e089a688503a.tar.xz | |
Add zabs, zadd, zdiv, zmod, zmodmul, zmodpow, zneg, zpow, zsub, and the newly introduced zmodsqr
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/zmodsqr.c')
| -rw-r--r-- | src/zmodsqr.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/zmodsqr.c b/src/zmodsqr.c new file mode 100644 index 0000000..36e9ed1 --- /dev/null +++ b/src/zmodsqr.c @@ -0,0 +1,17 @@ +/* See LICENSE file for copyright and license details. */ +#include "internals" + + +void +zmodsqr(z_t a, z_t b, z_t c) +{ + /* TODO What is the fastest way to do zmodsqr? */ + if (a == c) { + zset(libzahl_tmp_modsqr, c); + zsqr(a, b); + zmod(a, a, libzahl_tmp_modsqr); + } else { + zsqr(a, b); + zmod(a, a, c); + } +} |
