Clarify INumber.IsPositive and INumber.IsNegative documentation#80026
Clarify INumber.IsPositive and INumber.IsNegative documentation#80026stephentoub merged 2 commits intodotnet:mainfrom
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. |
dakersnar
left a comment
There was a problem hiding this comment.
I do think this wording update is clearer. LGTM.
The method name and documentation of
INumber<TSelf>.IsPositive(TSelf)implied that it would only returntruefor positive numbers, therefore excluding zero. However, all implementations of this interface do returntruefor zero.I also clarified that these methods only return
truefor real numbers, as complex numbers cannot be categorised into strictly "positive" and "negative".