mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 02:25:41 +00:00
Ensure CLS compliance for method signature
Use overloads instead of optional parameters
This commit is contained in:
parent
227e807f14
commit
643a254b87
@ -108,13 +108,23 @@ namespace X10D.DoubleExtensions
|
||||
return angle * (180.0 / Math.PI);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rounds the current value to the nearest whole number.
|
||||
/// </summary>
|
||||
/// <param name="value">The value to round.</param>
|
||||
/// <returns><paramref name="value" /> rounded to the nearest whole number.</returns>
|
||||
public static double Round(this double value)
|
||||
{
|
||||
return value.Round(1.0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rounds the current value to the nearest multiple of a specified number.
|
||||
/// </summary>
|
||||
/// <param name="value">The value to round.</param>
|
||||
/// <param name="nearest">The nearest multiple to which <paramref name="value" /> should be rounded.</param>
|
||||
/// <returns><paramref name="value" /> rounded to the nearest multiple of <paramref name="nearest"/>.</returns>
|
||||
public static double Round(this double value, double nearest = 1)
|
||||
public static double Round(this double value, double nearest)
|
||||
{
|
||||
return Math.Round(value / nearest) * nearest;
|
||||
}
|
||||
|
@ -109,13 +109,23 @@ namespace X10D.SingleExtensions
|
||||
return (float)((double)angle).RadiansToDegrees();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rounds the current value to the nearest whole number.
|
||||
/// </summary>
|
||||
/// <param name="value">The value to round.</param>
|
||||
/// <returns><paramref name="value" /> rounded to the nearest whole number.</returns>
|
||||
public static float Round(this float value)
|
||||
{
|
||||
return value.Round(1.0f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rounds the current value to the nearest multiple of a specified number.
|
||||
/// </summary>
|
||||
/// <param name="value">The value to round.</param>
|
||||
/// <param name="nearest">The nearest multiple to which <paramref name="value" /> should be rounded.</param>
|
||||
/// <returns><paramref name="value" /> rounded to the nearest multiple of <paramref name="nearest"/>.</returns>
|
||||
public static float Round(this float value, float nearest = 1)
|
||||
public static float Round(this float value, float nearest)
|
||||
{
|
||||
return (float)((double)value).Round(nearest);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user