libzahl

big integer library
git clone git://git.suckless.org/libzahl
Log | Files | Refs | README | LICENSE

zbset.3 (636B)


      1 .TH ZBSET 3 libzahl
      2 .SH NAME
      3 zbset - Set, clear, or flip a bit in a big integer
      4 .SH SYNOPSIS
      5 .nf
      6 #include <zahl.h>
      7 
      8 void zbset(z_t \fIa\fP, z_t \fIb\fP, size_t \fIindex\fP, int \fIset\fP);
      9 .fi
     10 .SH DESCRIPTION
     11 .B zbset
     12 either sets, clears, or flips the bit with the selected
     13 .I index
     14 in
     15 .IR b ,
     16 and stores the result in
     17 .IR a .
     18 .P
     19 The bit is set if
     20 .IR "(set>0)" ,
     21 clear if
     22 .IR "(set==0)" ,
     23 and flipped if
     24 .IR "(set<0)" .
     25 .P
     26 It is safe to call
     27 .B zbset
     28 with non-unique parameters.
     29 .SH SEE ALSO
     30 .BR zbtest (3),
     31 .BR zand (3),
     32 .BR zor (3),
     33 .BR zxor (3),
     34 .BR znot (3),
     35 .BR zlsh (3),
     36 .BR zrsh (3),
     37 .BR zsplit (3),
     38 .BR zlsb (3),
     39 .BR zbits (3)