diff --git a/CHANGELOG.md b/CHANGELOG.md index 851973c2a..ff8f8f6f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - X10D: Removed `IEnumerable.LowestCommonMultiple` for all integer types in favour of generic math. - X10D: Removed `IEnumerable.Product` for all integer types in favour of generic math. - X10D: Removed `IEnumerable.RangeTo` for all integer types in favour of generic math. +- X10D: Removed `T.Sign` for all numeric types in favour of generic math. ### Removed diff --git a/X10D/src/Math/DecimalExtensions.cs b/X10D/src/Math/DecimalExtensions.cs index 1aa678dd8..56bddc396 100644 --- a/X10D/src/Math/DecimalExtensions.cs +++ b/X10D/src/Math/DecimalExtensions.cs @@ -90,40 +90,6 @@ public static decimal Saturate(this decimal value) return System.Math.Clamp(value, 0.0m, 1.0m); } - /// - /// Returns an integer that indicates the sign of this decimal number. - /// - /// A signed number. - /// - /// A number that indicates the sign of , as shown in the following table. - /// - /// - /// - /// Return value - /// Meaning - /// - /// - /// - /// -1 - /// is less than zero. - /// - /// - /// 0 - /// is equal to zero. - /// - /// - /// 1 - /// is greater than zero. - /// - /// - /// - [Pure] - [MethodImpl(CompilerResources.MaxOptimization)] - public static int Sign(this decimal value) - { - return System.Math.Sign(value); - } - /// /// Returns the square root of this decimal number. /// diff --git a/X10D/src/Math/DoubleExtensions.cs b/X10D/src/Math/DoubleExtensions.cs index 51a7b7ac7..06abc82ed 100644 --- a/X10D/src/Math/DoubleExtensions.cs +++ b/X10D/src/Math/DoubleExtensions.cs @@ -300,41 +300,6 @@ public static double Sinh(this double value) return System.Math.Sinh(value); } - /// - /// Returns an integer that indicates the sign of this double-precision floating-point number. - /// - /// A signed number. - /// - /// A number that indicates the sign of , as shown in the following table. - /// - /// - /// - /// Return value - /// Meaning - /// - /// - /// - /// -1 - /// is less than zero. - /// - /// - /// 0 - /// is equal to zero. - /// - /// - /// 1 - /// is greater than zero. - /// - /// - /// - /// is equal to . - [Pure] - [MethodImpl(CompilerResources.MaxOptimization)] - public static int Sign(this double value) - { - return System.Math.Sign(value); - } - /// /// Returns the square root of this double-precision floating-point number. /// diff --git a/X10D/src/Math/Int16Extensions.cs b/X10D/src/Math/Int16Extensions.cs index d2f07076b..71594a553 100644 --- a/X10D/src/Math/Int16Extensions.cs +++ b/X10D/src/Math/Int16Extensions.cs @@ -38,40 +38,6 @@ public static int MultiplicativePersistence(this short value) return ((long)value).MultiplicativePersistence(); } - /// - /// Returns an integer that indicates the sign of this 16-bit signed integer. - /// - /// A signed number. - /// - /// A number that indicates the sign of , as shown in the following table. - /// - /// - /// - /// Return value - /// Meaning - /// - /// - /// - /// -1 - /// is less than zero. - /// - /// - /// 0 - /// is equal to zero. - /// - /// - /// 1 - /// is greater than zero. - /// - /// - /// - [Pure] - [MethodImpl(CompilerResources.MaxOptimization)] - public static int Sign(this short value) - { - return System.Math.Sign(value); - } - /// /// Wraps the current 16-bit signed integer between a low and a high value. /// diff --git a/X10D/src/Math/Int32Extensions.cs b/X10D/src/Math/Int32Extensions.cs index 8f235e15a..b4fefe4a0 100644 --- a/X10D/src/Math/Int32Extensions.cs +++ b/X10D/src/Math/Int32Extensions.cs @@ -38,40 +38,6 @@ public static int MultiplicativePersistence(this int value) return ((long)value).MultiplicativePersistence(); } - /// - /// Returns an integer that indicates the sign of this 32-bit signed integer. - /// - /// A signed number. - /// - /// A number that indicates the sign of , as shown in the following table. - /// - /// - /// - /// Return value - /// Meaning - /// - /// - /// - /// -1 - /// is less than zero. - /// - /// - /// 0 - /// is equal to zero. - /// - /// - /// 1 - /// is greater than zero. - /// - /// - /// - [Pure] - [MethodImpl(CompilerResources.MaxOptimization)] - public static int Sign(this int value) - { - return System.Math.Sign(value); - } - /// /// Wraps the current 32-bit signed integer between a low and a high value. /// diff --git a/X10D/src/Math/Int64Extensions.cs b/X10D/src/Math/Int64Extensions.cs index dd0d3988d..e06907ef1 100644 --- a/X10D/src/Math/Int64Extensions.cs +++ b/X10D/src/Math/Int64Extensions.cs @@ -88,40 +88,6 @@ public static int MultiplicativePersistence(this long value) return persistence; } - /// - /// Returns an integer that indicates the sign of this 64-bit signed integer. - /// - /// A signed number. - /// - /// A number that indicates the sign of , as shown in the following table. - /// - /// - /// - /// Return value - /// Meaning - /// - /// - /// - /// -1 - /// is less than zero. - /// - /// - /// 0 - /// is equal to zero. - /// - /// - /// 1 - /// is greater than zero. - /// - /// - /// - [Pure] - [MethodImpl(CompilerResources.MaxOptimization)] - public static int Sign(this long value) - { - return System.Math.Sign(value); - } - /// /// Wraps the current 64-bit signed integer between a low and a high value. /// diff --git a/X10D/src/Math/SingleExtensions.cs b/X10D/src/Math/SingleExtensions.cs index 9e70592b9..fa90dbfae 100644 --- a/X10D/src/Math/SingleExtensions.cs +++ b/X10D/src/Math/SingleExtensions.cs @@ -268,40 +268,6 @@ public static float Saturate(this float value) return System.Math.Clamp(value, 0.0f, 1.0f); } - /// - /// Returns an integer that indicates the sign of this single-precision floating-point number. - /// - /// A signed number. - /// - /// A number that indicates the sign of , as shown in the following table. - /// - /// - /// - /// Return value - /// Meaning - /// - /// - /// - /// -1 - /// is less than zero. - /// - /// - /// 0 - /// is equal to zero. - /// - /// - /// 1 - /// is greater than zero. - /// - /// - /// - [Pure] - [MethodImpl(CompilerResources.MaxOptimization)] - public static int Sign(this float value) - { - return MathF.Sign(value); - } - /// /// Returns the square root of this single-precision floating-point number. ///