title: Complete loss of accuracy in modulus when calculating with very large numbers
body: <p>I have the following problem:</p>
  
  <pre><code>&gt; 1e20 %% 3
  [1] 0
  Warning message:
  probable complete loss of accuracy in modulus 
  </code></pre>
  
  <p>The result can't be correct and I'm sure it is because <code>1e20</code> is really big. But I want to solve calculations like this in <code>R</code>. Is there a chance to come up with this? </p>
  
  <p>EDIT: 
  I want to do the following challenge:
  <a href="https://www.codeabbey.com/index/task_view/modular-calculator" rel="nofollow noreferrer">https://www.codeabbey.com/index/task_view/modular-calculator</a></p>
  
  <p>This is my code:</p>
  
  <pre><code>library(tidyverse)
  library(magrittr)
  
  get_result &lt;- function(.string){
  
    terms &lt;- .string %&gt;% 
      str_split("\n") %&gt;%
      unlist %&gt;% 
      str_replace("%", "%%") %&gt;% 
      str_squish
  
    terms[1] %&lt;&gt;% 
      str_c("x &lt;&lt;- ", .)
  
    terms[2:length(terms)] %&lt;&gt;%
      str_c("x &lt;&lt;- x ", .)
  
      map(terms, ~ {
        eval(parse(text = .x))      
        })
  
      x
  
  }
  
  get_result("6
  + 12
             * 99
             + 5224
             * 53
             * 2608
             * 4920
             + 48
             + 7
             * 54
             * 4074
             + 76
             * 2
             * 97
             + 4440
             + 3
             * 130
             + 432
             * 50
             * 1
             + 933
             + 3888
             + 600
             + 9634
             * 10
             * 59
             + 62
             * 358
             + 82
             + 1685
             * 78
             + 8
             * 266
             * 256
             * 26
             * 793
             + 1248
             * 746
             * 135
             * 10
             * 184
             + 4
             * 502
             * 60
             + 9047
             * 5
             + 416
             * 7
             * 6287
             * 8
             % 4185")
  
  </code></pre>
  
  <p>With the real test data I get a huge number before I want to use the modulus</p>