aboutsummaryrefslogtreecommitdiffstats
path: root/zahl.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-03-02 21:07:08 +0100
committerMattias Andrée <maandree@kth.se>2016-03-02 21:07:08 +0100
commit3ae8c069900514c1785fe4a84b6cdb0157dff59e (patch)
treeaec0c146010be40239c1582a8b8ae6e7b28aa045 /zahl.h
parentAdd zgcd (diff)
downloadlibzahl-3ae8c069900514c1785fe4a84b6cdb0157dff59e.tar.gz
libzahl-3ae8c069900514c1785fe4a84b6cdb0157dff59e.tar.bz2
libzahl-3ae8c069900514c1785fe4a84b6cdb0157dff59e.tar.xz
Add zand, zor, zxor, znot, zbtest, zsplit, and the newly introduced ztrunc
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--zahl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/zahl.h b/zahl.h
index 3816411..9879326 100644
--- a/zahl.h
+++ b/zahl.h
@@ -92,6 +92,7 @@ void zxor(z_t, z_t, z_t); /* a := b ^ c */
void znot(z_t, z_t); /* a := ~b */
void zlsh(z_t, z_t, size_t); /* a := b << c */
void zrsh(z_t, z_t, size_t); /* a := b >> c */
+void ztrunc(z_t, z_t, size_t); /* a := b & ((1 << c) - 1) */
int zbtest(z_t, size_t); /* (a >> b) & 1 */
void zsplit(z_t, z_t, z_t, size_t); /* a := c >> d, b := c - (a << d) */
size_t zbits(z_t); /* ⌊log₂ |a|⌋ + 1, 1 if a = 0 */