improved computation for binary numbers