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
Clarify INumber.IsPositive and INumber.IsNegative documentation #80026
Conversation
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsThe method name and documentation of I also clarified that these methods only return
|
You'll also need to update the docs here https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Numerics/INumberBase%601.xml It's worth noting that in the mathematics world whether or not That all being said, in the computer programming world and particularly due to things like the |
src/libraries/System.Private.CoreLib/src/System/Numerics/INumberBase.cs
Outdated
Show resolved
Hide resolved
Yes, I'll open a pull request for the other repository once the phrasing is finalised here. And yeah there are other definitions of "positive", but excluding zero is by far the most widespread, at least in Western education. And in any case, when multiple different definitions are present, it is always worth clarifying which definition is being used. |
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 do think this wording update is clearer. LGTM.
The method name and documentation of
INumber<TSelf>.IsPositive(TSelf)
implied that it would only returntrue
for positive numbers, therefore excluding zero. However, all implementations of this interface do returntrue
for zero.I also clarified that these methods only return
true
for real numbers, as complex numbers cannot be categorised into strictly "positive" and "negative".