title: C#: generic math functions (Min, Max etc.)
body: <p>I was thinking about writing generic functions for basic Math operations such as Min, Max etc.
  But i i dont know how to compare two generic types :</p>
  
  <pre><code>public T Max&lt;T&gt;(T v1, T v2) where T: struct
  {
     return (v1 &gt; v2 ? v1 : v2);
  }
  </code></pre>
  
  <p>How about that?</p>
  
  <p>Thank you.</p>