diff --git a/src/Math/Fixed/Fix64.cs b/src/Math/Fixed/Fix64.cs index 310d43d..808cefb 100644 --- a/src/Math/Fixed/Fix64.cs +++ b/src/Math/Fixed/Fix64.cs @@ -204,6 +204,14 @@ namespace MoonWorks.Math.Fixed return ((value - min) * (newMax - newMin)) / (max - min) + newMin; } + /// + /// Returns Floor(value / step) * step. Nearest multiple of step to a specified value + /// + public static Fix64 Step(Fix64 value, Fix64 step) + { + return Fix64.Floor(value / step) * step; + } + // Trigonometry functions ///