title: Warning C26451: Arithmetic overflow
body: <p>How do I solve these warnings?</p>
  <pre class="lang-cpp prettyprint-override"><code>// midiNote is a double as it is used in floating point equation
  // v is int because that's informative that the function wants whole numbers
  void setMidiNote(int v) { midiNote = v-48;  }
  </code></pre>
  <blockquote>
  <p>Warning   C26451  Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2).</p>
  </blockquote>
  <pre class="lang-cpp prettyprint-override"><code>// input should be 0 to 10 integer, and dank will be odd integers only
  // dank is a double, it is ultimately used in a floating point equation
  void setDarkIntensity(int v) { dank = v * 2 + 1; }
  </code></pre>
  <blockquote>
  <p>Warning   C26451  Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).</p>
  </blockquote>
  <blockquote>
  <p>Warning   C26451  Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2).</p>
  </blockquote>