zig icon indicating copy to clipboard operation
zig copied to clipboard

docs: Add doc comments to `std.math.isNan`

Open sorairolake opened this issue 1 month ago • 4 comments

std.math.isNan has no doc comments, so add it.

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 a NaN. This pull request adds documentation explaining this behavior. 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 documentation.

sorairolake avatar Nov 06 '25 12:11 sorairolake

This pull request adds documentation explaining this behavior. 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 documentation.

Something along the lines of

/// Returns true if x is not a number, and false otherwise

would be better because NaN is not being used to describe the isNan function.

saurabh-mish avatar Nov 07 '25 05:11 saurabh-mish

@saurabh-mish suggestion:

/// Returns `true` if `x` is not a number (NaN), and `false` otherwise.

or

/// Returns `true` if `x` is NaN (not a number), and `false` otherwise.

sorairolake avatar Nov 07 '25 13:11 sorairolake