mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-22 01:08:48 +00:00
refactor!: remove redundant Sign overloads
This commit is contained in:
parent
44d3aec9a6
commit
72dbaa72ba
@ -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>.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>.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 `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
|
### Removed
|
||||||
|
|
||||||
|
@ -90,40 +90,6 @@ public static class DecimalExtensions
|
|||||||
return System.Math.Clamp(value, 0.0m, 1.0m);
|
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>
|
/// <summary>
|
||||||
/// Returns the square root of this decimal number.
|
/// Returns the square root of this decimal number.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -300,41 +300,6 @@ public static class DoubleExtensions
|
|||||||
return System.Math.Sinh(value);
|
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>
|
/// <summary>
|
||||||
/// Returns the square root of this double-precision floating-point number.
|
/// Returns the square root of this double-precision floating-point number.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -38,40 +38,6 @@ public static class Int16Extensions
|
|||||||
return ((long)value).MultiplicativePersistence();
|
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>
|
/// <summary>
|
||||||
/// Wraps the current 16-bit signed integer between a low and a high value.
|
/// Wraps the current 16-bit signed integer between a low and a high value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -38,40 +38,6 @@ public static class Int32Extensions
|
|||||||
return ((long)value).MultiplicativePersistence();
|
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>
|
/// <summary>
|
||||||
/// Wraps the current 32-bit signed integer between a low and a high value.
|
/// Wraps the current 32-bit signed integer between a low and a high value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -88,40 +88,6 @@ public static class Int64Extensions
|
|||||||
return persistence;
|
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>
|
/// <summary>
|
||||||
/// Wraps the current 64-bit signed integer between a low and a high value.
|
/// Wraps the current 64-bit signed integer between a low and a high value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -268,40 +268,6 @@ public static class SingleExtensions
|
|||||||
return System.Math.Clamp(value, 0.0f, 1.0f);
|
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>
|
/// <summary>
|
||||||
/// Returns the square root of this single-precision floating-point number.
|
/// Returns the square root of this single-precision floating-point number.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user