Skip to content

ZA | 25-SDC-July | Luke Manyamazi | Sprint 1 | Number Systems Exercises #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Luke-Manyamazi
Copy link

@Luke-Manyamazi Luke-Manyamazi commented Jul 15, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Here's your brief as a list, based on what you've stated you've done:

I have:

  • Completed exercises on binary numbers and representations.
  • Converted numbers between binary, decimal, and hexadecimal.
  • Performed binary arithmetic.
  • Calculated bit requirements for various number ranges.
  • Identified the bitwise trick for checking powers of two.
  • Demonstrated how a single byte can represent a decimal number, an ASCII character, or a color.

Questions

Beyond these exercises, what's a practical, real-world scenario where understanding these low-level binary/hex/byte interpretations becomes critical in programming?

@Luke-Manyamazi Luke-Manyamazi added the Needs Review Participant to add when requesting review label Jul 15, 2025
@chinar-amrutkar chinar-amrutkar self-assigned this Jul 16, 2025
Copy link

@chinar-amrutkar chinar-amrutkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a think about the comment I added, and then we are good to go! Great work :)


How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)?
Answer:
Answer: by using the bitwise formula (N & (N - 1)) == 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you think of a simpler way of doing this?

@chinar-amrutkar chinar-amrutkar added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. Needs Review Participant to add when requesting review labels Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TECH ED] Number systems exercises
2 participants