Skip to content

Conversation

@sorairolake
Copy link
Contributor

Because I think the current doc comments for std.math.isPowerOfTwo is insufficient to explain how it works.

@nektro
Copy link
Contributor

nektro commented Nov 5, 2025

what is this adding over the name of the function?

@sorairolake
Copy link
Contributor Author

This function returns whether the given value is an integral power of two. This pull request adds documentation explaining this behavior. The current documentation makes it difficult to understand what this function does, since it only states that it asserts given_value > 0. We can guess what this function does from the function name and examples, but I think it would be easier to understand if there is proper documentation.

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