Is the number binary-heavy? An integer is binary-heavy if its binary representation contains more 1s than 0s while ignoring leading zeroes. For example 1 is binary-heavy, as its binary representation is simply 1, however 4 is not binary heavy, as its binary representation is 100. In the event of a tie (for example 2, with a binary representation of 10), the number is not considered binary-heavy.

Given a positive integer as input, output a truthy value if it is binary-heavy, and a falsey value if it is not.

Testcases

Format: input -&gt; binary -&gt; output

1          -&gt;                                1 -&gt; True
2          -&gt;                               10 -&gt; False
4          -&gt;                              100 -&gt; False
5          -&gt;                              101 -&gt; True
60         -&gt;                           111100 -&gt; True
316        -&gt;                        100111100 -&gt; True
632        -&gt;                       1001111000 -&gt; False
2147483647 -&gt;  1111111111111111111111111111111 -&gt; True
2147483648 -&gt; 10000000000000000000000000000000 -&gt; False


Scoring

This is code-golf so fewest bytes in each language wins
x86 Machine Code, 15 14 bytes

F3 0F B8 C1 0F BD D1 03 C0 42 2B D0 D6 C3


This is a function using Microsoft's __fastcall calling convention (first and only parameter in ecx, return value in eax, callee is allowed to clobber edx), though it can trivially be modified for other calling conventions that pass arguments in registers.

It returns 255 as truthy, and 0 as falsey.

It uses the undocumented (but widely supported) opcode salc.

Disassembly below:

;F3 0F B8 C1 
  popcnt eax, ecx ; Sets eax to number of bits set in ecx

;0F BD D1
  bsr edx, ecx    ; Sets edx to the index of the leading 1 bit of ecx

;03 C0
  add eax, eax

;42
  inc edx

;2B D0
  sub edx, eax

  ; At this point, 
  ;   edx = (index of highest bit set) + 1 - 2*(number of bits set)
  ; This is negative if and only if ecx was binary-heavy.

;D6
  salc           ; undocumented opcode. Sets al to 255 if carry flag 
                 ; is set, and to 0 otherwise. 

;C3
  ret


Try it online!

Thanks to Peter Cordes for suggesting replacing lzcnt with bsr.