Nez.Portable/Math/Mathf.cs
/// <summary>
/// rounds value to the nearest number in steps of roundToNearest. Ex: found 127 to nearest 5 results in 125
/// </summary>
/// <returns>The to nearest.</returns>
/// <param name="value">Value.</param>
/// <param name="roundToNearest">Round to nearest.</param>
rounds value to the nearest number in steps of roundToNearest. Ex: found 127 to nearest 5 results in 125
rounds value to the nearest number in steps of roundToNearest . Ex : found 127 to nearest 5 results in 125
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static float roundToNearest(float value, float roundToNearest)
        {
            return round(value / roundToNearest) * roundToNearest;
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] public static float roundToNearest ( float value , float roundToNearest ) { return round ( value / roundToNearest ) * roundToNearest ; }
rounds value to the nearest number in steps of roundToNearest.
rounds value to the nearest number in steps of roundToNearest .
The to nearest.
The to nearest .
value
float
None
roundToNearest
float
Round to nearest.
Round to nearest .