Better than anything I came up with.

I converted the long to binary and then summed up the digits

BTW:

What value has all 32 bits set?