Improvements to calculating single bit to set in an array representing a number.