-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Explain what "normal" is in Double.IsNormal #12281
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
base: main
Are you sure you want to change the base?
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates the API documentation for Double.IsNormal to clarify what “normal” means directly in the summary text.
Changes:
- Replaces the
IsNormal<summary>text with an explicit definition (not NaN, not infinite, not subnormal, and not zero).
| <see langword="true" /> if the value is normal; <see langword="false" /> otherwise.</returns> | ||
| <remarks>This effectively checks the value is not NaN, not infinite, not subnormal, and not zero.</remarks> |
Copilot
AI
Feb 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated
explains what “normal” means, but the text still relies on the term “normal” without the definition. Consider updating to use the same explicit criteria (or add the definition there) so readers don’t have to infer it from the summary/remarks.
Also, the criteria list is now repeated in both
and , which creates duplication that can drift over time. Consider removing the redundant list from or using for additional context instead of repeating the same definition.
Suggested change
<see langword="true" /> if the value is normal; <see langword="false" /> otherwise.</returns>
<remarks>This effectively checks the value is not NaN, not infinite, not subnormal, and not zero.</remarks>
<see langword="true" /> if the value is not NaN, not infinite, not subnormal, and not zero; <see langword="false" /> otherwise.</returns>
<remarks>Use this method to determine whether a double-precision floating-point number is a normal value before performing calculations that assume finite, nonzero magnitudes.</remarks>
| <see langword="true" /> if the value is normal; <see langword="false" /> otherwise.</returns> | |
| <remarks>This effectively checks the value is not NaN, not infinite, not subnormal, and not zero.</remarks> | |
| <see langword="true" /> if the value is not NaN, not infinite, not subnormal, and not zero; <see langword="false" /> otherwise.</returns> | |
| <remarks>Use this method to determine whether a double-precision floating-point number is a normal value before performing calculations that assume finite, nonzero magnitudes.</remarks> |
| <Docs> | ||
| <param name="d">A double-precision floating-point number.</param> | ||
| <summary>Determines whether the specified value is normal.</summary> | ||
| <summary>Determines whether the specified value is not NaN, not infinite, not subnormal, and not zero.</summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're wanting to not be repetitive, then repeating subnormal doesn't really help either.. The technical definition is:
| <summary>Determines whether the specified value is not NaN, not infinite, not subnormal, and not zero.</summary> | |
| <summary>Determines whether the specified value is a finite non-zero value with magnitude greater than or equal to <c>2<sup>-1022</sup></c>.</summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect Single, Half, NFloat, and INumberBase<TSelf> to all be updated in the same PR.
I would also expect other definitions like IsInfinite, IsSubnormal, IsFinite, etc to be updated if required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And as per the Copilot guidance below, the summary and remarks are effectively just mirroring eachother now, so the remarks need to either be removed or updated.
Summary
The documentation for Double.IsNormal is wholly unhelpful. It says it checks if a number is "Normal". Only in the remarks, "normal" is explained. This changes it to make it clear what it actually checks.