diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-06-28 08:53:45 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-06-28 08:53:45 -0700 |
commit | f69bc0426a3f94318ef89dba18cdad3cbed180e7 (patch) | |
tree | 5f5094f936576ac668941774681b3bb58c0b1188 /txr.1 | |
parent | 4e927689cb21336212f1aea7cb61433d5372b87a (diff) | |
download | txr-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.1 | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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 |