title: Safest way to divide unsigned long int by unsigned long long
body: <p>What is the safest way to divide B by A, assuming the following types for each of them?</p>
  
  <pre><code>unsigned long long A;
  unsigned long int B;
  </code></pre>
  
  <p>I am already using the following line to do that. It works fine, however, sometimes it fails with the Segmentation Faults.</p>
  
  <pre><code>double C;
  C= double(B)/double(A);
  </code></pre>
  
  <p>Thanks</p>