1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-10 03:05:42 +00:00

(#15) Improve xmldoc for float/double.Round

This commit is contained in:
Oliver Booth 2021-03-10 12:56:25 +00:00
parent b8d9d880a8
commit 227e807f14
2 changed files with 12 additions and 12 deletions

View File

@ -109,14 +109,14 @@ namespace X10D.DoubleExtensions
}
/// <summary>
/// Rounds to the nearest value.
/// Rounds the current value to the nearest multiple of a specified number.
/// </summary>
/// <param name="v">The value to round.</param>
/// <param name="nearest">The nearest value.</param>
/// <returns>Returns the rounded value.</returns>
public static double Round(this double v, double nearest = 1)
/// <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)
{
return Math.Round(v / nearest) * nearest;
return Math.Round(value / nearest) * nearest;
}
private static double LerpInternal(double a, double b, double t)

View File

@ -110,14 +110,14 @@ namespace X10D.SingleExtensions
}
/// <summary>
/// Rounds to the nearest value.
/// Rounds the current value to the nearest multiple of a specified number.
/// </summary>
/// <param name="v">The value to round.</param>
/// <param name="nearest">The nearest value.</param>
/// <returns>Returns the rounded value.</returns>
public static float Round(this float v, float nearest = 1)
/// <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)
{
return (float)((double)v).Round(nearest);
return (float)((double)value).Round(nearest);
}
}
}