title: Wrap value into range [min,max] without division
body: <p>Is there any way in C# to wrap a given value x between x_min and x_max. The value should not be clamped as in <code>Math.Min/Max</code> but wrapped like a <code>float</code> modulus.</p>
  
  <p>A way to implement this would be:</p>
  
  <pre><code>x = x - (x_max - x_min) * floor( x / (x_max - x_min));
  </code></pre>
  
  <p>However, I am wondering if there is an algorithm or C# method that implements the same functionality without divisions and without the likely float-limited-precision issues that may arise when the value lies far away from the desired range.</p>