1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-10 04:55: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> /// <summary>
/// Rounds to the nearest value. /// Rounds the current value to the nearest multiple of a specified number.
/// </summary> /// </summary>
/// <param name="v">The value to round.</param> /// <param name="value">The value to round.</param>
/// <param name="nearest">The nearest value.</param> /// <param name="nearest">The nearest multiple to which <paramref name="value" /> should be rounded.</param>
/// <returns>Returns the rounded value.</returns> /// <returns><paramref name="value" /> rounded to the nearest multiple of <paramref name="nearest"/>.</returns>
public static double Round(this double v, double nearest = 1) 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) private static double LerpInternal(double a, double b, double t)

View File

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