Skip to content

Conversation

@sorairolake
Copy link
Contributor

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

@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 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.

@saurabh-mish
Copy link
Contributor

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.

@sorairolake
Copy link
Contributor Author

@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.

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.

3 participants