title: How to subtract an isize from a usize?
body: <p>I've got a <code>usize</code> that does hit very large values. I also apply a delta to it that I receive in the form of an <code>isize</code>. What's the best way to apply the delta without losing any precision?</p>
  
  <pre><code>fn main() {
      let mut big_indexer: usize = 4295032832; // 2^32 + 2^16
      let delta: isize = -65792; // 2^16 + 2^8
  
      let big_indexer = (big_indexer as isize) + delta // Can't do this b/c overflow
      let big_indexer = big_indexer + (delta as usize) // Can't do this b/c lose negative number
  
      // This is ugly
      if delta &lt; 0 {
          let big_indexer -= delta.abs() as usize;
      } else {
          let big_indexer += delta.abs() as usize;
      }
  }
  </code></pre>