title: How REST function in Numbers works in Swift
body: <p>In Apple Numbers the <code>MOD</code> function differs from Swift (in the German version it is <code>REST</code>.</p>
  
  <p>In Numbers:</p>
  
  <p><code>4,37937=MOD(−1,90373;6,2831)</code></p>
  
  <p>versus </p>
  
  <p>In swift 3:</p>
  
  <pre><code>let rem1: Double = -1.90373
  let rem = rem1.truncatingRemainder(dividingBy: 6.28318530717959)
  print(rem)
  </code></pre>
  
  <p><code>Prints: -1.90373</code></p>
  
  <p>What I am doing wrong?</p>