[release/6.0] Add explicit APIs to Double/Single/Half/TimeOnly (#58845)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Thu, 9 Sep 2021 14:58:51 +0000 (08:58 -0600)
committerGitHub <noreply@github.com>
Thu, 9 Sep 2021 14:58:51 +0000 (08:58 -0600)
* Add explicit APIs to Double/Single/Half/TimeOnly

* sq

* Fix get accessor in ref

Co-authored-by: Prashanth Govindarajan <prgovi@microsoft.com>
src/libraries/System.Private.CoreLib/src/System/Double.cs
src/libraries/System.Private.CoreLib/src/System/Half.cs
src/libraries/System.Private.CoreLib/src/System/Single.cs
src/libraries/System.Private.CoreLib/src/System/TimeOnly.cs
src/libraries/System.Runtime/ref/System.Runtime.cs

index 3165535..6fde540 100644 (file)
@@ -755,6 +755,30 @@ namespace System
         static double IFloatingPoint<double>.Truncate(double x)
             => Math.Truncate(x);
 
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<double>.IsFinite(double d) => IsFinite(d);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<double>.IsInfinity(double d) => IsInfinity(d);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<double>.IsNaN(double d) => IsNaN(d);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<double>.IsNegative(double d) => IsNegative(d);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<double>.IsNegativeInfinity(double d) => IsNegativeInfinity(d);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<double>.IsNormal(double d) => IsNormal(d);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<double>.IsPositiveInfinity(double d) => IsPositiveInfinity(d);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<double>.IsSubnormal(double d) => IsSubnormal(d);
+
         // static double IFloatingPoint<double>.AcosPi(double x)
         //     => Math.AcosPi(x);
         //
index c42d7a4..c8791e1 100644 (file)
@@ -1059,6 +1059,31 @@ namespace System
         static Half IFloatingPoint<Half>.Truncate(Half x)
             => (Half)MathF.Truncate((float)x);
 
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<Half>.IsFinite(Half x) => IsFinite(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<Half>.IsInfinity(Half x) => IsInfinity(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<Half>.IsNaN(Half x) => IsNaN(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<Half>.IsNegative(Half x) => IsNegative(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<Half>.IsNegativeInfinity(Half x) => IsNegativeInfinity(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<Half>.IsNormal(Half x) => IsNormal(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<Half>.IsPositiveInfinity(Half x) => IsPositiveInfinity(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<Half>.IsSubnormal(Half x) => IsSubnormal(x);
+
+
         // static Half IFloatingPoint<Half>.AcosPi(Half x)
         //     => (Half)MathF.AcosPi((float)x);
         //
index 24150ed..26ea34a 100644 (file)
@@ -747,6 +747,30 @@ namespace System
         static float IFloatingPoint<float>.Truncate(float x)
             => MathF.Truncate(x);
 
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<float>.IsFinite(float x) => IsFinite(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<float>.IsInfinity(float x) => IsInfinity(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<float>.IsNaN(float x) => IsNaN(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<float>.IsNegative(float x) => IsNegative(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<float>.IsNegativeInfinity(float x) => IsNegativeInfinity(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<float>.IsNormal(float x) => IsNormal(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<float>.IsPositiveInfinity(float x) => IsPositiveInfinity(x);
+
+        [RequiresPreviewFeatures]
+        static bool IFloatingPoint<float>.IsSubnormal(float x) => IsSubnormal(x);
+
         // static float IFloatingPoint<float>.AcosPi(float x)
         //     => MathF.AcosPi(x);
         //
index d89c04f..d842806 100644 (file)
@@ -974,6 +974,13 @@ namespace System
         // [RequiresPreviewFeatures]
         // static checked TimeSpan ISubtractionOperators<TimeOnly, TimeOnly, TimeSpan>.operator -(TimeOnly left, TimeOnly right)
         //     => checked(left - right);
+
+        [RequiresPreviewFeatures]
+        static TimeOnly IMinMaxValue<TimeOnly>.MinValue => MinValue;
+
+        [RequiresPreviewFeatures]
+        static TimeOnly IMinMaxValue<TimeOnly>.MaxValue => MaxValue;
+
 #endif // FEATURE_GENERIC_MATH
     }
 }
index 5de2f8d..b617e4d 100644 (file)
@@ -2553,6 +2553,23 @@ namespace System
         static double IFloatingPoint<double>.Truncate(double x) { throw null; }
 
         [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<double>.IsFinite(double d) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<double>.IsInfinity(double d) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<double>.IsNaN(double d) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<double>.IsNegative(double d) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<double>.IsNegativeInfinity(double d) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<double>.IsNormal(double d) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<double>.IsPositiveInfinity(double d) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<double>.IsSubnormal(double d) { throw null; }
+
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
         static double IIncrementOperators<double>.operator ++(double value) { throw null; }
 
         [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
@@ -3270,6 +3287,23 @@ namespace System
         static System.Half IFloatingPoint<System.Half>.Truncate(System.Half x) { throw null; }
 
         [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<System.Half>.IsFinite(System.Half x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<System.Half>.IsInfinity(System.Half x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<System.Half>.IsNaN(System.Half x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<System.Half>.IsNegative(System.Half x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<System.Half>.IsNegativeInfinity(System.Half x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<System.Half>.IsNormal(System.Half x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<System.Half>.IsPositiveInfinity(System.Half x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<System.Half>.IsSubnormal(System.Half x) { throw null; }
+
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
         static System.Half IIncrementOperators<System.Half>.operator ++(System.Half value) { throw null; }
 
         [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
@@ -5595,6 +5629,23 @@ namespace System
         static float IFloatingPoint<float>.Truncate(float x) { throw null; }
 
         [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<float>.IsFinite(float x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<float>.IsInfinity(float x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<float>.IsNaN(float x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<float>.IsNegative(float x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<float>.IsNegativeInfinity(float x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<float>.IsNormal(float x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<float>.IsPositiveInfinity(float x) { throw null; }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static bool IFloatingPoint<float>.IsSubnormal(float x) { throw null; }
+
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
         static float IIncrementOperators<float>.operator ++(float value) { throw null; }
 
         [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
@@ -6062,6 +6113,11 @@ namespace System
 
         [System.Runtime.Versioning.RequiresPreviewFeatures]
         static System.TimeSpan ISubtractionOperators<System.TimeOnly, System.TimeOnly, System.TimeSpan>.operator -(System.TimeOnly left, System.TimeOnly right) { throw null; }
+
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static System.TimeOnly IMinMaxValue<System.TimeOnly>.MinValue { get { throw null; } }
+        [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]
+        static System.TimeOnly IMinMaxValue<System.TimeOnly>.MaxValue { get { throw null; } }
 #endif // FEATURE_GENERIC_MATH
     }
     public partial class TimeoutException : System.SystemException