title: How to get amount of 1s from 64 bit number
body: <blockquote>
    <p>Possible duplicate: <a href="https://stackoverflow.com/q/2709430/800214">Count number of bits in a 64-bit (long, big)
    integer?</a></p>
  </blockquote>
  
  <p>For an image comparison algorithm I get a 64bit number as result. The amount of 1s in the number (ulong) (101011011100...) tells me how similar two images are, so I need to count them. How would I best do this in C#? 
  I'd like to use this in a WinRT &amp; Windows Phone App, so I'm also looking for a low-cost method.</p>
  
  <p>EDIT: As I have to count the bits for a large number of Images, I'm wondering if the lookup-table-approach might be best. But I'm not really sure how that works...</p>