Next Previous Up Contents
Next: Conversions
Up: General Functions
Previous: Arrays

B.1.3 Bits

Bit manipulation functions.

Note that for bitwise AND, OR, XOR of integer values etc you can use the java bitwise operators "&", "|", "^".

hasBit( value, bitIndex )
Determines whether a given integer has a certain bit set to 1.

bitCount( i )
Returns the number of set bits in the 64-bit two's complement representation of the integer argument.

toBinary( value )
Converts the integer argument to a binary string consisting only of 1s and 0s.

fromBinary( binVal )
Converts a string representing a binary number to its integer value.


Next Previous Up Contents
Next: Conversions
Up: General Functions
Previous: Arrays

TOPCAT - Tool for OPerations on Catalogues And Tables
Starlink User Note253
TOPCAT web page: http://www.starlink.ac.uk/topcat/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@jiscmail.ac.uk