"Fossies" - the Fresh Open Source Software Archive

Member "txr-218/mpi/mplogic.h" (20 Jun 2019, 1007 Bytes) of package /linux/misc/txr-218.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "mplogic.h" see the Fossies "Dox" file reference documentation.

    1 /* mplogic.h
    2  *
    3  * by Michael J. Fromberger <http://www.dartmouth.edu/~sting/>
    4  * Developed 1998-2004.
    5  * Assigned to the public domain as of 2002; see README.
    6  *
    7  * Bitwise logical operations on MPI values
    8  *
    9  * $Id: mplogic.h,v 1.1 2004/02/08 04:29:29 sting Exp $
   10  */
   11 
   12 #include "mpi.h"
   13 
   14 /* The logical operations treat an mp_int as if it were a bit vector,
   15  * without regard to its sign (an mp_int is represented in a signed
   16  * magnitude format).  Values are treated as if they had an infinite
   17  * string of zeros left of the most-significant bit.
   18  */
   19 
   20 #define MP_EVEN MP_YES
   21 #define MP_ODD MP_NO
   22 
   23 mp_err mpl_not(mp_int *a, mp_int *b);
   24 mp_err mpl_and(mp_int *a, mp_int *b, mp_int *c);
   25 mp_err mpl_or(mp_int *a, mp_int *b, mp_int *c);
   26 mp_err mpl_xor(mp_int *a, mp_int *b, mp_int *c);
   27 
   28 mp_err mpl_rsh(mp_int *a, mp_int *b, mp_digit d);
   29 mp_err mpl_lsh(mp_int *a, mp_int *b, mp_digit d);
   30 
   31 mp_err mpl_num_set(mp_int *a, mp_size *num);
   32 mp_err mpl_num_clear(mp_int *a, mp_size *num);
   33 mp_err mpl_parity(mp_int *a);