35 include <primitives.scad>;
84 ) = ((floor(v / pow(2, b)) % 2) == t);
102 : ((v == 0) && (bv >= pow(2, w))) ?
empty_v
169 : ((v1 + v2) == 0) ? 0
170 : (((v1 % 2) > 0) && ((v2 % 2) > 0)) ?
190 : ((v1 + v2) == 0) ? 0
191 : (((v1 % 2) > 0) || ((v2 % 2) > 0)) ?
192 bitwise_or(floor(v1/2), floor(v2/2), bv*2) + bv
211 : ((v1 + v2) == 0) ? 0
212 : (((v1 % 2) > 0) != ((v2 % 2) > 0)) ?
231 : ((v == 0) && (bv >= pow(2, w))) ? 0
function bitwise_and(v1, v2, bv=1)
Base-two bitwise AND operation for integers.
function bitwise_s2i(v)
Decode a base-two string of bits to an integer value.
function first(v)
Return the first element of an iterable value.
function is_integer(v)
Test if a value is an integer.
function is_empty(v)
Test if an iterable value is empty.
function bitwise_not(v, w=1, bv=1)
Base-two bitwise NOT operation for an integer.
function bitwise_i2v(v, w=1, bv=1)
Encode an integer value as a base-two vector of bits.
function bitwise_v2i(v)
Decode a base-two vector of bits to an integer value.
empty_v
A vector with no content (the empty vector).
function bitwise_is_equal(v, b, t=1)
Test if a base-two bit position of an integer value equals a test bit.
function bitwise_xor(v1, v2, bv=1)
Base-two bitwise XOR operation for integers.
function bitwise_rsh(v, s=1)
Base-two bitwise right-shift operation for an integer.
function bitwise_or(v1, v2, bv=1)
Base-two bitwise OR operation for integers.
function ntail(v, n=1)
Return a vector containing all but the first n elements of an iterable value.
function bitwise_i2s(v, w=1)
Encode an integer value as a base-two string of bits.
function vstr(v)
Convert all vector elements to strings and concatenate.
function bitwise_lsh(v, s=1, bm=1, bv=1)
Base-two bitwise left-shift operation for an integer.