<jupyter_start><jupyter_text>Bit Manipulation routineThis is a repository of bit manipulation routines.<jupyter_code>x = 0x05  #00000111

# Print in Hex and Binary
print ("x = 0x{0:x}".format(x))
print ("x = b\'{0:b}'".format(x))

# Create bitmask with bit 4 enabled
y = 1 << 4
print ("y = b\'{0:b}'".format(y))

# Turn on bit 4 of x
z = x | y
print ("z = x | y = b\'{0:b}'".format(z))

# Turn off z bit 4
w = z ^ y
print ("z ^ y = b\'{0:b}'".format(w))

# Multiply x by 2
print ("2*{} = {}".format(x, x << 1))<jupyter_output>x = 0x5
x = b'101'
y = b'10000'
z = x | y = b'10101'
z ^ y = b'101'
2*5 = 10
{'fraction_non_alphanumeric': 0.21096345514950166, 'fraction_numerical': 0.07807308970099668, 'mean_word_length': 3.5681818181818183, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '119872', 'license': 'MIT', 'n_tokens_mistral': 304, 'n_tokens_neox': 268, 'n_words': 84, 'path': 'bit-manipulation.ipynb', 'repo_name': 'jazracherif/algorithms', 'size': '602'}