title: Dividing large numbers in Python
body: <p>I'm trying to divide some large numbers in Python but i'm getting some strange results</p>
  
  <pre><code>NStr = "7D5E9B01D4DCF9A4B31D61E62F0B679C79695ACA70BACF184518" \
         "8BDF94B0B58FAF4A3E1C744C5F9BAB699ABD47BA842464EE93F4" \
         "9B151CC354B21D53DC0C7FADAC44E8F4BDF078F935D9D07A2C07" \
         "631D0DFB0B869713A9A83393CEC42D898516A28DDCDBEA13E87B" \
         "1F874BC8DC06AF03F219CE2EA4050FA996D30CE351257287" 
  
  N = long(NStr, 16)
  f2 = 476
  
  fmin = N / float(f2)
  
  print N - (fmin * float(f2))
  </code></pre>
  
  <p>This outputs as <code>0.0</code> as expected. However if I, for example, change the code to</p>
  
  <pre><code>fmin = N / float(f2)
  fmin += 1
  </code></pre>
  
  <p>I still get an output of <code>0.0</code></p>
  
  <p>I also tried using the decimal package</p>
  
  <pre><code>fmin = Decimal(N) / Decimal(f2)
  print Decimal(N) - (fmin * Decimal(f2))
  </code></pre>
  
  <p>But that gives me an output of <code>-1.481136900397802034028076389E+280</code></p>
  
  <p>I assume i'm not telling python how to handle the large numbers properly, but i'm stumped on where to go from here.</p>
  
  <p>I should also add that the end goal is to calculate</p>
  
  <pre><code>fmin = ceil(N / float(f2))
  </code></pre>
  
  <p>as a long and as accurate as possible</p>