title: How to check if number is divisible in c#?
body: <p>I need to know how to do this procedure.</p>
  
  <pre><code>calculation1: 1/4 = 0,25
  calculation2: 1/8 = 0,125
  calculation3: 47/183 = 0,25683060109289617486338797814207......
  calculation4: 58/889 = 0,06524184476940382452193475815523......
  calculation5: 1/5 = 0,2
  </code></pre>
  
  <p>The results of calculations 1, 2 and 5 will give a short result, no periods or and endless string of digits. The results of calculations 3 and 4 are very long and complicated.</p>
  
  <p>How can I check which calculation is an "easy one" and gives a "short" result.</p>
  
  <p>I tried this and it gave a wrong result for sure...
  like you can see, the results of the calculations have the datatype <code>double</code> in my application.</p>
  
  <pre><code>static bool IsInt(double x)
      {
          try
          {
              int y = Int32.Parse(x.ToString());
              return true;
          }
          catch
          {
               return false;
          }
      }
  </code></pre>
  
  <p>I hope it is clear what I'm asking. </p>