A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

2 of 3 added 241 characters in body

# MATL, 7 bytes

3X2Z%Bz


Try it online!

Exact transliteration of my MATLAB answer. Note that input and output are implicit.

3X2 % Literal 'int64'
Z%   % Typecast: changes input (implicitly taken and converted to double) to 64 bit int without changing underlying bits
B     % Convert integer to array of 1s and 0s
z     % Count nonzero entries