aboutsummaryrefslogtreecommitdiffstats
path: root/zahl.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-03-03 12:47:39 +0100
committerMattias Andrée <maandree@kth.se>2016-03-03 12:47:39 +0100
commit3728c12ecbe308092b213f1b664303a48858a2b8 (patch)
treeb4a42c978eb513605ef58092c84ecbecbff795dd /zahl.h
parentAdd zdivmod (diff)
downloadlibzahl-3728c12ecbe308092b213f1b664303a48858a2b8.tar.gz
libzahl-3728c12ecbe308092b213f1b664303a48858a2b8.tar.bz2
libzahl-3728c12ecbe308092b213f1b664303a48858a2b8.tar.xz
Add zbset
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'zahl.h')
-rw-r--r--zahl.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/zahl.h b/zahl.h
index 4f2a2c8..8f91809 100644
--- a/zahl.h
+++ b/zahl.h
@@ -100,6 +100,9 @@ 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 */
size_t zlsb(z_t); /* Index of first set bit, SIZE_MAX if none are set. */
+/* If d > 0: a := b | (1 << c), f d = 0: a := b & ~(1 << c), if d < 0: a := b ^ (1 << c) */
+void zbset(z_t, z_t, size_t, int);
+
/* Number theory. */