For example, if a variable s = 1337, then set ones to 6 because 1337 as a sixteen bit binary number is 000010100111001, which contains six ones.