Skip to content

Commit c37a900

Browse files
committed
docs: add Wikipedia reference link in find_upper_and_lower_nibble docstring
1 parent 5c72193 commit c37a900

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

bit_manipulation/find_upper_lower_nibble.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ def get_nibbles(num: int) -> tuple[int, int]:
55
A nibble is 4 bits. The lower nibble is the last 4 bits, and
66
the upper nibble is the first 4 bits of the 8-bit number.
77
8+
See also: https://en.wikipedia.org/wiki/Nibble
9+
810
>>> get_nibbles(100) # binary: 01100100
911
(6, 4)
1012
>>> get_nibbles(255) # binary: 11111111

0 commit comments

Comments
 (0)