Binary Vector Representation of Signed Integers

**BVEC**
is a Python library which
demonstrates how signed integers can be stored as
binary vectors, and arithmetic can be performed on them.

The computer code and data files made available on this web page are distributed under the GNU LGPL license.

**BVEC** is available in
a C version and
a C++ version and
a FORTRAN77 version and
a FORTRAN90 version and
a MATLAB version and
a Python version.

UBVEC, a Python library which demonstrates how unsigned binary vectors, strings of 0's and 1's, can represent nonnegative integers or subsets or other mathematical objects, for which various arithmetic and logical operations can be defined.

- bvec_add.py, adds two binary vectors.
- bvec_complement2.py, returns the complement of a binary vector.
- bvec_mul.py, multiplies two binary vectors.
- bvec_next.py, returns the next binary vector.
- bvec_next_grlex.py, returns the next binary vector in GRLEX order.
- bvec_print.py, prints a binary vector.
- bvec_sub.py, subtracts two binary vectors.
- bvec_to_i4.py, converts a (signed) binary vector to an integer.
- bvec_uniform.py, returns a random BVEC.
- i4_bclr.py, sets a given bit of an I4 to 0.
- i4_bset.py, sets a given bit of an I4 to 1.
- i4_btest.py, returns TRUE if the J-th bit of an I4 is 1.
- i4_to_bvec.py, converts an I4 to a (signed) binary vector.
- i4_uniform_ab.py, returns a random I4 in a given range.
- timestamp.py, returns the current YMDHMS date as a timestamp.

- bvec_test.py, calls all the tests.
- bvec_test.sh, runs all the tests.
- bvec_test_output.txt, the output file.

You can go up one level to the Python source codes.