Skip to content
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

Fix round_pow2 function for edge cases #210

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

visitorckw
Copy link
Collaborator

The round_pow2 function was returning incorrect values when the input x was less than or equal to 1. Specifically, it was returning 2 for x=1 when compiled with GCC or Clang, and 0 for x=0 when compiled with other compilers. According to the documentation in syscall.md, both of these cases should return 1. This commit addresses the issue by explicitly handling these edge cases and returning 1.

The round_pow2 function was returning incorrect values when the input x
was less than or equal to 1. Specifically, it was returning 2 for x=1
when compiled with GCC or Clang, and 0 for x=0 when compiled with other
compilers. According to the documentation in syscall.md, both of these
cases should return 1. This commit addresses the issue by explicitly
handling these edge cases and returning 1.
@jserv jserv merged commit 6a17871 into sysprog21:master Sep 8, 2023
11 checks passed
@jserv
Copy link
Contributor

jserv commented Sep 8, 2023

Thank @visitorckw for contributing!

@visitorckw visitorckw deleted the fix/round_pow2 branch September 8, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants