title: Normalise orientation between 0 and 360
body: <p>I'm working on a simple rotate routine which normalizes an objects rotation between 0 and 360 degrees. My C# code seems to be working but I'm not entirely happy with it. Can anyone improve on the code below making it a bit more robust?</p>
  
  <pre><code>public void Rotate(int degrees)
      {
          this.orientation += degrees;
  
          if (this.orientation &lt; 0)
          {
              while (this.orientation &lt; 0)
              {
                  this.orientation += 360;
              }
          }
          else if (this.orientation &gt;= 360)
          {
              while (this.orientation &gt;= 360)
              {
                  this.orientation -= 360;
              }
          }
      }
  </code></pre>