title: How to convert a decimal base (10) to a negabinary base (-2)?
body: <p>I want to write a program to convert from decimal to negabinary.</p>
  
  <p>I cannot figure out how to convert from decimal to negabinary.</p>
  
  <p>I have no idea about how to find the rule and how it works.</p>
  
  <p>Example: <code>7(base10)--&gt;11011(base-2)</code></p>
  
  <p>I just know it is <code>7 = (-2)^0*1 + (-2)^1*1 + (-2)^2*0 + (-2)^3*1 + (-2)^4*1</code>.</p>