Skip to content

Commit 621ddda

Browse files
committed
docs: clarify method to test if a binary number is a power of two
- Updated README.md to provide a clearer explanation for testing powers of two in binary. - Replaced the previous answer with a more descriptive method.
1 parent 998b2cf commit 621ddda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

number-systems/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ How many bits would you need in order to store the numbers between 0 and 1000 in
3535
Answer: 10 bits
3636

3737
How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)?
38-
Answer: 2^n
38+
Answer: It can be tested if one of the bits in the value is one e.g 0100, 10, 100
3939

4040
Convert the decimal number 14 to hex.
4141
Answer: E

0 commit comments

Comments
 (0)