zig icon indicating copy to clipboard operation
zig copied to clipboard

docs: Update doc comments for `std.math.isPowerOfTwo`

Open sorairolake opened this issue 1 month ago • 2 comments

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

sorairolake avatar Nov 05 '25 13:11 sorairolake

what is this adding over the name of the function?

nektro avatar Nov 05 '25 18:11 nektro

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.

sorairolake avatar Nov 06 '25 12:11 sorairolake