title: Best (safest) way to convert from double to int
body: <p>I'm curious as to the best way to convert a double to an int. Runtime safety is my primary concern here (it doesn't necessarily have to be the fastest method, but that would be my secondary concern).  I've left a few options I can come up with below.  Can anyone weigh in on which is best practice?  Any better ways to accomplish this that I haven't listed?</p>
  
  <pre><code>        double foo = 1;
          int bar;
  
          // Option 1
          bool parsed = Int32.TryParse(foo.ToString(), out bar);
          if (parsed)
          {
              //...
          }
  
          // Option 2
          bar = Convert.ToInt32(foo);
  
          // Option 3
          if (foo &lt; Int32.MaxValue &amp;&amp; foo &gt; Int32.MinValue) { bar = (Int32)foo; }
  </code></pre>