title: Convert Decimal to Binary (Bitmap of a character)
body: <p>I have a question about getting a Bitmap from a character, for example A.</p>
  
  <p>I was already searching in the internet but no direct help. I found <a href="http://www.codeproject.com/Articles/29461/Led-Font-Creator-with-Scrolling-Display" rel="nofollow">this</a> page, where my plans are described.</p>
  
  <p>Quotation from this site:</p>
  
  <p>e.g. character char="A" bits="227873781661662" which translates to “0000 0000 0000 0000 1100 1111 0011 1111 1111 1111 1100 1111 0011 1111 1101 1110” in binary.</p>
  
  <p>How do they get from 227873781661662 to 0000 0000 0000 0000 1100 1111 0011 1111 1111 1111 1100 1111 0011 1111 1101 1110?</p>
  
  <pre><code>int num = 227873781661662;
  int n = log(num)/log(2)+1;          //Figure out the maximum power of 2 needed
  NSString *result = @"";             //Empty string
  for (int j=n; j&gt;=0; j--)            //Iterate down through the powers of 2
  {
      if (pow(2,j) &gt;= num)            //If the number is greater than current power of 2
      {
          num -= pow(2,j);                             //Subtract the power of 2
          result = [result stringByAppendingString:@"1"]; //Add a 1 to result string
      }
      else result = [result stringByAppendingString:@"0"]; //Otherwise add a 0
  
      if (num == 0) break;                              //If we're at 0, stop
  }
  NSLog(@"num = %i",num);
  </code></pre>
  
  <p>What is wrong with this? Thanks for help</p>