From c11a8e95b56626ab5b29d92b201688db26afdc8d Mon Sep 17 00:00:00 2001 From: Jochem <29899660+JochCool@users.noreply.github.com> Date: Wed, 28 Dec 2022 19:30:00 +0100 Subject: [PATCH 1/2] Clarify INumber.IsPositive and INumber.IsNegative documentation --- .../src/System/Numerics/INumberBase.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/INumberBase.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/INumberBase.cs index 90f1d2db84006..92f8282a03115 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/INumberBase.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/INumberBase.cs @@ -166,9 +166,9 @@ static virtual TSelf CreateTruncating(TOther value) /// true if is NaN; otherwise, false. static abstract bool IsNaN(TSelf value); - /// Determines if a value is negative. + /// Determines if a value represents a negative real number. /// The value to be checked. - /// true if is negative; otherwise, false. + /// true if represents a negative real number; otherwise, false. /// This function returning false does not imply that will return true. A complex number, a + bi for non-zero b, is not positive nor negative static abstract bool IsNegative(TSelf value); @@ -191,9 +191,9 @@ static virtual TSelf CreateTruncating(TOther value) /// static abstract bool IsOddInteger(TSelf value); - /// Determines if a value is positive. + /// Determines if a value represents zero or a positive real number. /// The value to be checked. - /// true if is positive; otherwise, false. + /// true if represents zero or a positive real number; otherwise, false. /// This function returning false does not imply that will return true. A complex number, a + bi for non-zero b, is not positive nor negative static abstract bool IsPositive(TSelf value); From 30c0ecfc7b964c7785672a195d4566dc941123ab Mon Sep 17 00:00:00 2001 From: Jochem <29899660+JochCool@users.noreply.github.com> Date: Wed, 28 Dec 2022 22:07:17 +0100 Subject: [PATCH 2/2] Add clarification for negative zero --- .../src/System/Numerics/INumberBase.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/INumberBase.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/INumberBase.cs index 92f8282a03115..0040a887d171b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/INumberBase.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/INumberBase.cs @@ -168,8 +168,11 @@ static virtual TSelf CreateTruncating(TOther value) /// Determines if a value represents a negative real number. /// The value to be checked. - /// true if represents a negative real number; otherwise, false. - /// This function returning false does not imply that will return true. A complex number, a + bi for non-zero b, is not positive nor negative + /// true if represents negative zero or a negative real number; otherwise, false. + /// + /// If this type has signed zero, then -0 is also considered negative. + /// This function returning false does not imply that will return true. A complex number, a + bi for non-zero b, is not positive nor negative + /// static abstract bool IsNegative(TSelf value); /// Determines if a value is negative infinity. @@ -193,8 +196,11 @@ static virtual TSelf CreateTruncating(TOther value) /// Determines if a value represents zero or a positive real number. /// The value to be checked. - /// true if represents zero or a positive real number; otherwise, false. - /// This function returning false does not imply that will return true. A complex number, a + bi for non-zero b, is not positive nor negative + /// true if represents (positive) zero or a positive real number; otherwise, false. + /// + /// If this type has signed zero, then -0 is not considered positive, but +0 is. + /// This function returning false does not imply that will return true. A complex number, a + bi for non-zero b, is not positive nor negative + /// static abstract bool IsPositive(TSelf value); /// Determines if a value is positive infinity.