Skip to content

London | 26-March-SDC | Ammad Ur Rehman | Sprint 1 | Number Systems#425

Open
anosidium wants to merge 2 commits intoCodeYourFuture:mainfrom
anosidium:number-systems
Open

London | 26-March-SDC | Ammad Ur Rehman | Sprint 1 | Number Systems#425
anosidium wants to merge 2 commits intoCodeYourFuture:mainfrom
anosidium:number-systems

Conversation

@anosidium
Copy link

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Answered all the questions.

Questions

It wasn’t easy and is still very hard. I need an explanation that really clicks for me.

@anosidium anosidium added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 24, 2026
Copy link

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Since the answers in this exercise are fairly clear, can you check your work against the answers on
https://github.com/CodeYourFuture/Module-Tools/blob/solutions/number-systems/README.md?plain=1

Should you have any question regarding number systems, feel free to raise them in the comment of this PR.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 25, 2026
@anosidium anosidium added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 25, 2026
Copy link

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Look good.


How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)?
Answer: A binary number is a power of two if it has exactly one 1 bit, or equivalently if n & (n - 1) == 0 (for n > 0)
Answer: A binary number is a power of two if it has exactly one 1 bit, or equivalently if n & (n - 1) == 0 (for n > 0) (Actual answer: Test that it has exactly one 1.)
Copy link

Choose a reason for hiding this comment

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

Do you know how this check, n & (n - 1) == 0 can determine numbers that are power of 2?

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants