BitCount - script and chart function

BitCount() finds how many bits in the binary equivalent of a number are set to 1. That is, the function returns the number of set bits in integer_number, where integer_number is interpreted as a signed 32-bit integer.



Return data type: integer

Examples and results:  

Examples Results
BitCount ( 3 ) 3 is binary 101, therefore this returns 2
BitCount ( -1 ) -1 is 64 ones in binary, therefore this returns 64

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?