Skip to content

Fix INumber.Sign documentation for zero return value #11480

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 19, 2025

The documentation for INumber<T>.Sign method incorrectly stated that when the input value is zero, it returns INumberBase<TSelf>.Zero. However, the actual behavior is that it returns the integer value 0 (Int32).

Changes Made

  • Updated the return value description in xml/System.Numerics/INumber1.xmlto correctly state that zero inputs return0instead of referencingINumberBase.Zero`

Before

<returns>A positive value if <paramref name="value" /> is positive, <see cref="P:System.Numerics.INumberBase`1.Zero" /> if <paramref name="value" /> is zero, and a negative value if <paramref name="value" /> is negative.</returns>

After

<returns>A positive value if <paramref name="value" /> is positive, <c>0</c> if <paramref name="value" /> is zero, and a negative value if <paramref name="value" /> is negative.</returns>

This aligns with the method's actual return type of System.Int32 and matches the behavior documented in the code examples showing that Math.Sign() returns integer values (0, 1, -1).

Fixes #11207.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] The INumber<T>.Sign method states the wrong return type for zero. Fix INumber.Sign documentation for zero return value Jun 19, 2025
Copilot finished work on behalf of jeffhandley June 19, 2025 07:03
@Copilot Copilot AI requested a review from jeffhandley June 19, 2025 07:03
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.

The INumber<T>.Sign method states the wrong return type for zero.
2 participants