1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-24 15:58:48 +00:00

refactor!: remove redundant Sign overloads

This commit is contained in:
Oliver Booth 2024-11-14 16:29:15 +00:00
parent 44d3aec9a6
commit 72dbaa72ba
Signed by: oliverbooth
GPG Key ID: 2A862C3F46178E8E
7 changed files with 1 additions and 205 deletions

View File

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- X10D: Removed `IEnumerable<T>.LowestCommonMultiple` for all integer types in favour of generic math.
- X10D: Removed `IEnumerable<T>.Product` for all integer types in favour of generic math.
- X10D: Removed `IEnumerable<T>.RangeTo` for all integer types in favour of generic math.
- X10D: Removed `T.Sign` for all numeric types in favour of generic math.
### Removed

View File

@ -90,40 +90,6 @@ public static class DecimalExtensions
return System.Math.Clamp(value, 0.0m, 1.0m);
}
/// <summary>
/// Returns an integer that indicates the sign of this decimal number.
/// </summary>
/// <param name="value">A signed number.</param>
/// <returns>
/// A number that indicates the sign of <paramref name="value" />, as shown in the following table.
///
/// <list type="table">
/// <listheader>
/// <term>Return value</term>
/// <description>Meaning</description>
/// </listheader>
///
/// <item>
/// <term>-1</term>
/// <description><paramref name="value" /> is less than zero.</description>
/// </item>
/// <item>
/// <term>0</term>
/// <description><paramref name="value" /> is equal to zero.</description>
/// </item>
/// <item>
/// <term>1</term>
/// <description><paramref name="value" /> is greater than zero.</description>
/// </item>
/// </list>
/// </returns>
[Pure]
[MethodImpl(CompilerResources.MaxOptimization)]
public static int Sign(this decimal value)
{
return System.Math.Sign(value);
}
/// <summary>
/// Returns the square root of this decimal number.
/// </summary>

View File

@ -300,41 +300,6 @@ public static class DoubleExtensions
return System.Math.Sinh(value);
}
/// <summary>
/// Returns an integer that indicates the sign of this double-precision floating-point number.
/// </summary>
/// <param name="value">A signed number.</param>
/// <returns>
/// A number that indicates the sign of <paramref name="value" />, as shown in the following table.
///
/// <list type="table">
/// <listheader>
/// <term>Return value</term>
/// <description>Meaning</description>
/// </listheader>
///
/// <item>
/// <term>-1</term>
/// <description><paramref name="value" /> is less than zero.</description>
/// </item>
/// <item>
/// <term>0</term>
/// <description><paramref name="value" /> is equal to zero.</description>
/// </item>
/// <item>
/// <term>1</term>
/// <description><paramref name="value" /> is greater than zero.</description>
/// </item>
/// </list>
/// </returns>
/// <exception cref="ArithmeticException"><paramref name="value" /> is equal to <see cref="double.NaN" />.</exception>
[Pure]
[MethodImpl(CompilerResources.MaxOptimization)]
public static int Sign(this double value)
{
return System.Math.Sign(value);
}
/// <summary>
/// Returns the square root of this double-precision floating-point number.
/// </summary>

View File

@ -38,40 +38,6 @@ public static class Int16Extensions
return ((long)value).MultiplicativePersistence();
}
/// <summary>
/// Returns an integer that indicates the sign of this 16-bit signed integer.
/// </summary>
/// <param name="value">A signed number.</param>
/// <returns>
/// A number that indicates the sign of <paramref name="value" />, as shown in the following table.
///
/// <list type="table">
/// <listheader>
/// <term>Return value</term>
/// <description>Meaning</description>
/// </listheader>
///
/// <item>
/// <term>-1</term>
/// <description><paramref name="value" /> is less than zero.</description>
/// </item>
/// <item>
/// <term>0</term>
/// <description><paramref name="value" /> is equal to zero.</description>
/// </item>
/// <item>
/// <term>1</term>
/// <description><paramref name="value" /> is greater than zero.</description>
/// </item>
/// </list>
/// </returns>
[Pure]
[MethodImpl(CompilerResources.MaxOptimization)]
public static int Sign(this short value)
{
return System.Math.Sign(value);
}
/// <summary>
/// Wraps the current 16-bit signed integer between a low and a high value.
/// </summary>

View File

@ -38,40 +38,6 @@ public static class Int32Extensions
return ((long)value).MultiplicativePersistence();
}
/// <summary>
/// Returns an integer that indicates the sign of this 32-bit signed integer.
/// </summary>
/// <param name="value">A signed number.</param>
/// <returns>
/// A number that indicates the sign of <paramref name="value" />, as shown in the following table.
///
/// <list type="table">
/// <listheader>
/// <term>Return value</term>
/// <description>Meaning</description>
/// </listheader>
///
/// <item>
/// <term>-1</term>
/// <description><paramref name="value" /> is less than zero.</description>
/// </item>
/// <item>
/// <term>0</term>
/// <description><paramref name="value" /> is equal to zero.</description>
/// </item>
/// <item>
/// <term>1</term>
/// <description><paramref name="value" /> is greater than zero.</description>
/// </item>
/// </list>
/// </returns>
[Pure]
[MethodImpl(CompilerResources.MaxOptimization)]
public static int Sign(this int value)
{
return System.Math.Sign(value);
}
/// <summary>
/// Wraps the current 32-bit signed integer between a low and a high value.
/// </summary>

View File

@ -88,40 +88,6 @@ public static class Int64Extensions
return persistence;
}
/// <summary>
/// Returns an integer that indicates the sign of this 64-bit signed integer.
/// </summary>
/// <param name="value">A signed number.</param>
/// <returns>
/// A number that indicates the sign of <paramref name="value" />, as shown in the following table.
///
/// <list type="table">
/// <listheader>
/// <term>Return value</term>
/// <description>Meaning</description>
/// </listheader>
///
/// <item>
/// <term>-1</term>
/// <description><paramref name="value" /> is less than zero.</description>
/// </item>
/// <item>
/// <term>0</term>
/// <description><paramref name="value" /> is equal to zero.</description>
/// </item>
/// <item>
/// <term>1</term>
/// <description><paramref name="value" /> is greater than zero.</description>
/// </item>
/// </list>
/// </returns>
[Pure]
[MethodImpl(CompilerResources.MaxOptimization)]
public static int Sign(this long value)
{
return System.Math.Sign(value);
}
/// <summary>
/// Wraps the current 64-bit signed integer between a low and a high value.
/// </summary>

View File

@ -268,40 +268,6 @@ public static class SingleExtensions
return System.Math.Clamp(value, 0.0f, 1.0f);
}
/// <summary>
/// Returns an integer that indicates the sign of this single-precision floating-point number.
/// </summary>
/// <param name="value">A signed number.</param>
/// <returns>
/// A number that indicates the sign of <paramref name="value" />, as shown in the following table.
///
/// <list type="table">
/// <listheader>
/// <term>Return value</term>
/// <description>Meaning</description>
/// </listheader>
///
/// <item>
/// <term>-1</term>
/// <description><paramref name="value" /> is less than zero.</description>
/// </item>
/// <item>
/// <term>0</term>
/// <description><paramref name="value" /> is equal to zero.</description>
/// </item>
/// <item>
/// <term>1</term>
/// <description><paramref name="value" /> is greater than zero.</description>
/// </item>
/// </list>
/// </returns>
[Pure]
[MethodImpl(CompilerResources.MaxOptimization)]
public static int Sign(this float value)
{
return MathF.Sign(value);
}
/// <summary>
/// Returns the square root of this single-precision floating-point number.
/// </summary>