title: Arithmetic with very small numbers in R
body: <p>I'm trying to work with some probabilities that get very small which causes issues. For example</p>
  
  <pre><code>probs &lt;- c(4.225867e-03,3.463125e-04,2.480971e-05,1.660538e-06,1.074064e-07,6.829168e-09,4.305051e-10,2.702241e-11,1.692533e-12,1.058970e-13,6.622117e-15,4.139935e-16,2.587807e-17,1.617488e-18,1.010964e-19,6.318630e-21,3.949177e-22 2.468246e-23,1.542657e-24,9.641616e-26,6.026013e-27,3.766259e-28,2.353912e-29,1.471195e-30,9.194971e-32
  </code></pre>
  
  <p>However any arithmetic with this vector causes everything after the 12th entry to round off to zero (probably because it's less than .Machine$double.eps). For example:</p>
  
  <pre><code>probs &gt; 0
  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
  </code></pre>
  
  <p>but</p>
  
  <pre><code>1-probs &lt; 1
  [1]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
  </code></pre>
  
  <p>I've tried using the gmp package but I'm doing combinatoric based calculations and as.bigq(probs) gets really slow when raised to large powers.</p>
  
  <p>Any ways to get around this?</p>