title: Windows batch file IF failure - How can 30000000000000 equal 40000000000?
body: <p>IF gives the wrong answer when I try to compare 2 large numbers.</p>
  
  <p>For example, this simple batch file</p>
  
  <pre><code>@echo off
  setlocal
  set n1=30000000000000
  set n2=40000000000
  if %n1% gtr %n2% echo %n1% is greater than %n2%
  if %n1% lss %n2% echo %n1% is less than %n2%
  if %n1% equ %n2% echo %n1% is equal to %n2%
  </code></pre>
  
  <p>produces</p>
  
  <pre><code>30000000000000 is equal to 40000000000
  </code></pre>
  
  <p>What is going on, and how do I fix this?</p>