version 1.1, 1999/12/08 05:47:44 |
version 1.2, 1999/12/21 02:47:33 |
|
|
|
@comment $OpenXM$ |
|
\BJP |
@node bit $B1i;;(B,,, $BAH$_9~$_H!?t(B |
@node bit $B1i;;(B,,, $BAH$_9~$_H!?t(B |
@section bit $B1i;;(B |
@section bit $B1i;;(B |
|
\E |
|
\BEG |
|
@node Bit operations,,, Built-in Function |
|
@section Bit operations |
|
\E |
|
|
@menu |
@menu |
* iand ior ixor:: |
* iand ior ixor:: |
* ishift:: |
* ishift:: |
@end menu |
@end menu |
|
|
@node iand ior ixor,,, bit $B1i;;(B |
\JP @node iand ior ixor,,, bit $B1i;;(B |
|
\EG @node iand ior ixor,,, Bit operations |
@subsection @code{iand}, @code{ior}, @code{ixor} |
@subsection @code{iand}, @code{ior}, @code{ixor} |
@findex iand |
@findex iand |
@findex ior |
@findex ior |
|
|
|
|
@table @t |
@table @t |
@item iand(@var{i1},@var{i2}) |
@item iand(@var{i1},@var{i2}) |
:: bit $B$4$H$N(B and |
\JP :: bit $B$4$H$N(B and |
|
\EG :: bitwise and |
@item ior(@var{i1},@var{i2}) |
@item ior(@var{i1},@var{i2}) |
:: bit $B$4$H$N(B or |
\JP :: bit $B$4$H$N(B or |
|
\EG :: bitwise or |
@item ixor(@var{i1},@var{i2}) |
@item ixor(@var{i1},@var{i2}) |
:: bit $B$4$H$N(B xor |
\JP :: bit $B$4$H$N(B xor |
|
\EG :: bitwise xor |
@end table |
@end table |
|
|
@table @var |
@table @var |
@item return |
@item return |
$B@0?t(B |
\JP $B@0?t(B |
|
\EG integer |
@item i1,i2 |
@item i1,i2 |
$B@0?t(B |
\JP $B@0?t(B |
|
\EG integer |
@end table |
@end table |
|
|
@itemize @bullet |
@itemize @bullet |
|
\BJP |
@item |
@item |
$B@0?t(B @var{i1}, @var{i2} $B$N@dBPCM$r(B bit $BNs$H$_$F1i;;$9$k(B. |
$B@0?t(B @var{i1}, @var{i2} $B$N@dBPCM$r(B bit $BNs$H$_$F1i;;$9$k(B. |
@item |
@item |
$B0z?t$NId9f$OL5;k$7(B, $BHsIi$NCM$rJV$9(B. |
$B0z?t$NId9f$OL5;k$7(B, $BHsIi$NCM$rJV$9(B. |
|
\E |
|
\BEG |
|
@item |
|
The absolute value of the argument is regarded as a bit string. |
|
@item |
|
The sign of the argument is ignored and a non-negative integer is returned. |
|
\E |
@end itemize |
@end itemize |
|
|
@example |
@example |
|
|
@end example |
@end example |
|
|
@table @t |
@table @t |
@item $B;2>H(B |
\JP @item $B;2>H(B |
|
\EG @item References |
@fref{ishift}. |
@fref{ishift}. |
@end table |
@end table |
|
|
@node ishift,,, bit $B1i;;(B |
\JP @node ishift,,, bit $B1i;;(B |
|
\EG @node ishift,,, Bit operations |
@subsection @code{ishift} |
@subsection @code{ishift} |
@findex ishift |
@findex ishift |
|
|
|
|
|
|
@table @var |
@table @var |
@item return |
@item return |
$B@0?t(B |
\JP $B@0?t(B |
|
\EG integer |
@item i,count |
@item i,count |
$B@0?t(B |
\JP $B@0?t(B |
|
\EG integer |
@end table |
@end table |
|
|
@itemize @bullet |
@itemize @bullet |
|
\BJP |
@item |
@item |
$B@0?t(B @var{i} $B$N@dBPCM$r(B bit $BNs$H$_$F(B shift $B$9$k(B. |
$B@0?t(B @var{i} $B$N@dBPCM$r(B bit $BNs$H$_$F(B shift $B$9$k(B. |
@item |
@item |
@var{i} $B$NId9f$OL5;k$7(B, $BHsIi$NCM$rJV$9(B. |
@var{i} $B$NId9f$OL5;k$7(B, $BHsIi$NCM$rJV$9(B. |
@item |
@item |
@var{count} $B$,@5$J$i$P1&(B shift, $BIi$J$i$P:8(B shift $B$r9T$&(B. |
@var{count} $B$,@5$J$i$P1&(B shift, $BIi$J$i$P:8(B shift $B$r9T$&(B. |
|
\E |
|
\BEG |
|
@item |
|
The absolute value of @var{i} is regarded as a bit string. |
|
@item |
|
The sign of @var{i} is ignored and a non-negative integer is returned. |
|
@item |
|
If @var{count} is positive, then @var{i} is shifted to the right. |
|
If @var{count} is negative, then @var{i} is shifted to the left. |
|
\E |
@end itemize |
@end itemize |
|
|
@example |
@example |
|
|
@end example |
@end example |
|
|
@table @t |
@table @t |
@item $B;2>H(B |
\JP @item $B;2>H(B |
|
\EG @item References |
@fref{iand ior ixor}. |
@fref{iand ior ixor}. |
@end table |
@end table |