summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-06-28 08:53:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-06-28 08:53:45 -0700
commitf69bc0426a3f94318ef89dba18cdad3cbed180e7 (patch)
tree5f5094f936576ac668941774681b3bb58c0b1188 /txr.1
parent4e927689cb21336212f1aea7cb61433d5372b87a (diff)
downloadtxr-f69bc0426a3f94318ef89dba18cdad3cbed180e7.tar.gz
txr-f69bc0426a3f94318ef89dba18cdad3cbed180e7.tar.bz2
txr-f69bc0426a3f94318ef89dba18cdad3cbed180e7.zip
* arith.c (bit): New function.
* eval.c (eval_init): Register bit as intrinsic. * lib.h (bit): Declared. * mpi-patches/add-bitops (mp_bit): New function. * txr.1: Documented bit
Diffstat (limited to 'txr.1')
-rw-r--r--txr.122
1 files changed, 22 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index f2f26476..499eb25a 100644
--- a/txr.1
+++ b/txr.1
@@ -11207,6 +11207,28 @@ a right shift does not exhaust the infinite sequence of 1 digits which
extends to the left. Thus if -4 is shifted right it becomes -2 because
the bitwise representations are ...111100 and ...11110.
+.SS Function bit
+
+.TP
+Syntax:
+
+ (bit <value> <bit>)
+
+.TP
+Description:
+
+The bit function tests whether the integer <value> has a 1 in bit position <bit>.
+The <bit> argument must be a non-negative integer. A value of zero of <bit>
+indicates the least significant bit position of <value>.
+
+The bit function has a boolean result, returning the symbol t if bit <bit>
+of <value> is set, otherwise nil.
+
+If <value> is negative, it is treated as if it had an infinite-bit two's
+complement representation. For instance, if value is -2, then the bit
+function returns nil for a <bit> value of zero, and t for all other values,
+since the infinite bit two's complement representation of -2 is ...11110.
+
.SS Function mask
.TP