Binary Vector Representation of Signed Integers
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.
Related Data and Programs:
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
adds two binary vectors.
returns the complement of a binary vector.
multiplies two binary vectors.
returns the next binary vector.
returns the next binary vector in GRLEX order.
prints a binary vector.
subtracts two binary vectors.
converts a (signed) binary vector to an integer.
returns a random BVEC.
sets a given bit of an I4 to 0.
sets a given bit of an I4 to 1.
returns TRUE if the J-th bit of an I4 is 1.
converts an I4 to a (signed) binary vector.
returns a random I4 in a given range.
returns the current YMDHMS date as a timestamp.
Examples and Tests:
You can go up one level to
the Python source codes.
Last revised on 15 June 2015.