add Fix64.Step

custom_video_shaders
cosmonaut 2022-09-22 20:17:13 -07:00
parent 32f80282a0
commit bace9f570d
1 changed files with 8 additions and 0 deletions

View File

@ -204,6 +204,14 @@ namespace MoonWorks.Math.Fixed
return ((value - min) * (newMax - newMin)) / (max - min) + newMin; return ((value - min) * (newMax - newMin)) / (max - min) + newMin;
} }
/// <summary>
/// Returns Floor(value / step) * step. Nearest multiple of step to a specified value
/// </summary>
public static Fix64 Step(Fix64 value, Fix64 step)
{
return Fix64.Floor(value / step) * step;
}
// Trigonometry functions // Trigonometry functions
/// <summary> /// <summary>