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

Improve description of bit32.extract. #585

Merged
merged 2 commits into from
Jul 8, 2022
Merged

Improve description of bit32.extract. #585

merged 2 commits into from
Jul 8, 2022

Conversation

Anaminus
Copy link
Contributor

@Anaminus Anaminus commented Jul 8, 2022

Fix description incorrectly saying that parameter w specifies an upper range. w is actually a width. Proof:

print(bit32.extract(2^32-1, 3, 4)) -- prints 15, not 1.

Also indicate that the position is 0-based, and that the function will error if the selected range exceeds the allowed bounds.

Fix description incorrectly saying that parameter w specifies an upper range. w is actually a width. Proof:

    print(bit32.extract(2^32-1, 3, 4)) -- prints 15, not 1.

Also indicate that the position is 0-based, and that the function will error if the selected range exceeds the allowed bounds.
@zeux
Copy link
Collaborator

zeux commented Jul 8, 2022

Thanks! Would you mind fixing replace as well?

Fix description of w parameter, indicate that index is 0-based, and indicate that selected range causes an error if out of bounds.
@zeux zeux merged commit 6ad8239 into luau-lang:master Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants