bit1(x)

Read(1990) Label: binary, number of 1s,

Description:

Get the number of 1s in a specified number’s complement binary.

Syntax:

bit1(x)

Note:

The function gets the number of 1s in x’s complement binary.

 

When x is a sequence, find the total of 1’s in all members’ complement binaries.

Parameter:

x

A long integer or a sequence of long integers

Return value:

Integer

Example:

 

A

 

1

=bit1(5)

The value of converting 5 to binary is 101 and the result is 2.

2

[1,3,5,6]

 

3

=bit1(A2)

Return 7.