title: Complex Numbers Seemingly Arising from Non-Complex Logarithms
body: <p>I have a simple program written in TI-BASIC that converts from base 10 to base 2  </p>
  
  <pre><code>0-&gt;B
  1-&gt;E
  Input "DEC:",D
  Repeat D=0
  int(round(log(D)/log(2),1))-&gt;E
  round(E)-&gt;E
  B+10^E-&gt;B
  D-2^E-&gt;D
  End
  Disp B
  </code></pre>
  
  <p>This will sometimes return an the error 'ERR: DATA TYPE'. I checked, and this is because the variable D, will sometimes become a complex number. I am not sure how this happens.  </p>
  
  <p>This happens with seemingly random numbers, like 5891570. It happens with this number, but not something close to it like 5891590 Which is strange. It also happens with 1e30, But not 1e25. Another example is 1111111111111111, and not 1111111111111120.  </p>
  
  <p>I haven't tested this thoroughly, and don't see any pattern in these numbers. Any help would be appreciated.</p>