The IDL_Integer class contains static methods that are available for integers. In addition, because IDL_Integer is a subclass of IDL_Number, all of the IDL_Number and IDL_Variable methods are also available.
            Superclasses
            IDL_Number             
            IDL_Integer
             
                - BitLength: Returns the number of bits in the current value, ignoring leading zero bits.
- BitGet: Returns the requested bit associated with the current value.
- BitSet: Returns a scalar or array of values after setting the bits on the current value.
- BitShift: Returns a scalar or array of values after shifting the bits on the current value.
- ToASCII: Converts the current number to an ASCII string.
- ToBinary: Converts the current number to a binary string.
- ToHex: Converts the current number to a hex string.
- ToOctal: Converts the current number to an octal string.
IDL_Integer::BitLength
            The IDL_Integer::BitLength method returns the number of bits in the scalar or array, ignoring any leading zero bits. 
            Examples
            num = [0, 1, 2, 7, 16385]
            PRINT, num.BitLength( )
            IDL prints:
            0  1  2  3  15
            Syntax
            Result = var.BitLength(  )
            Return Value
            A scalar byte or a byte array of the same dimensions as the variable. Each element in the Result will contain the number of bits in the corresponding value.
            Arguments
            None.
            Keywords
            None.
            IDL_Integer::BitGet
            The IDL_Integer::BitGet method returns a byte array of 0's or 1's indicating whether a particular bit was set.
            Examples
            Print the 3rd bit value of each element of an array:
            num = INDGEN(8)
            PRINT, num.BitGet( 3 )
            IDL prints:
            0 0 0 0 1 1 1 1
            Syntax
            Result = var.BitGet( Location )
            Return Value
            A byte array containing the bit value (0 or 1) of each element of the variable.
            Arguments
            Location
            A scalar or array designating the location of the requested bit. If Location is a scalar then the result is an array of 0's and 1's of the same dimensions as var, with 0 if the specified bit is not set for that element, and 1 if the bit is set for that element.
            If Location is an array then the result is an array of 0's and 1's of one higher dimension than the input. The first dimension will be the same length as Location. For example:
            IDL> n = indgen(4,3)
            IDL> help, n.bitget([1,3])
            <Expression>    BYTE      = Array[2, 4, 3]
            Keywords
            None.
            IDL_Integer::BitSet
            The IDL_Integer::BitSet method returns the variable after setting the provided bit or bits. This is equivalent to the bitwise OR operator.
            Examples
            Print the value of a variable after setting the bits on each element:
            IDL> num = [0, 1, 2, 4]
             
            IDL> PRINT, num.BitSet(5) 
            32      33      34      36
             
            PRINT, num.BitSet([1, 3]) 
            10      11      10      14
            Syntax
            Result = var.BitSet(  Location [, /CLEAR] [, /FLIP])
            Return Value
            The scalar or array of values of the variable after their bits have been set.
            Arguments
            Location
            The location of which bit to set. If Location is an array then all of those bit locations are set on each element in the array.
            Keywords
            CLEAR
            Set this keyword to clear the bits specified by Location.
            FLIP
            Set this keyword to flip the bits specified by Location.
            IDL_Integer::BitShift
            The IDL_Integer::BitShift method returns a scalar or array after a bit shift operation.
            Examples
            Print the value of a number after shifting the bit:
            num = [1, 10, 100]
            
             
            PRINT, num.BitShift( [-1, 5, 0] )
            PRINT, num.BitShift( [-1, 5, 0], /CIRCULAR )
            IDL prints:
            0     320     100
            -32768     320     100
            Syntax
            Result = var.BitShift( Direction [, /CIRCULAR] )
            Return Value
            The value of the scalar or array after the bit shift operation.
            Arguments
            Direction
            A scalar or array containing the number of bit positions and the direction of the shift. If Direction is a scalar then the same bit shift is applied to every element of var. If Direction is an array, then each element of Direction gives the bit shift for the corresponding element of var. If Direction has fewer elements than var, then the extra elements of var will be dropped.
            If the element of Direction is positive, the related element of the array is left-shifted that many bit positions, with 0 bits filling vacated positions.
            If the element of Direction is negative, the related element of the array is right-shifted that many bit positions, with 0 bits filling vacated positions.
            Keywords
            CIRCULAR
            Set this keyword to  shift the number circularly (i.e., shifting right a value of 1 would return -32768).
            IDL_Integer::ToASCII
            The IDL_Integer::ToASCII method returns a string containing the ASCII representation of a number or array of numbers.
            Examples
            Print the ASCII string value of an array:
            num = [72, 101, 108, 108, 111]
            PRINT, num.ToASCII( )
            IDL prints:
            Hello
            Print the ASCII string values of a two-dimensional array:
            num = [[73,68,76], $
                [105,115,32], $
                [102,117,110]]
            HELP, num.ToASCII( )
            PRINT, num.ToASCII( ), /IMPLIED
            IDL prints:
            <Expression>    STRING    = Array[3]
            IDL
            is
            fun
            Syntax
            Result = var.ToASCII(  )
            Return Value
            A scalar string or string array containing the ASCII values.
            If var is a scalar or 1-dimensional array then the result will be a scalar string with all of the ASCII characters concatenated together. If var is a multi-dimensional array then the result will be a string array of one less dimension, where the characters in the first dimension have been concatenated (see the examples above).
            Arguments
            None.
            Keywords
            None.
            IDL_Integer::ToBinary
            The IDL_Integer::ToBinary method returns a string containing the binary representation of the number.
            Examples
            Print the hex value of a number:
            num = [65385, 976]
            PRINT, num.ToBinary( ), /IMPLIED
            PRINT, num.ToBinary( WIDTH=16 ), /IMPLIED
            IDL prints:
            1111111101101001
            1111010000
            1111111101101001
            0000001111010000
            Syntax
            Result = var.ToBinary(  [WIDTH=value] )
            Return Value
            A scalar string or string array containing the binary representation. If var is an array then the result will be a string array of the same dimensions as the input.
            Arguments
            None.
            Keywords
            WIDTH
            Set the WIDTH to an integer in the range 0–255 indicating the number of digits in the result.  If the binary representation is smaller than the width, then the result will be padded with 0's at the front. If WIDTH=0 or is not specified, then no zero padding is used.
            Note: If the binary representation is larger than the width, then the result will be filled with asterisks (*) instead of the number.
            IDL_Integer::ToHex
            The IDL_Integer::ToHex method returns a string containing the hex value of the number.
            Examples
            Print the hex value of a number:
            num = [65385, 976]
            PRINT, num.ToHex( ), /IMPLIED
            PRINT, num.ToHex( WIDTH=8 ), /IMPLIED
            IDL prints:
            FF69
            3D0
            0000FF69
            000003D0
            Syntax
            Result = var.ToHex(   [/LOWER] [, WIDTH=value]  )
            Return Value
            A scalar string or string array containing the hex values. If var is an array then the result will be a string array of the same dimensions as the input.
            Arguments
            None.
            Keywords
            LOWER
            Set this keyword to use lowercase characters for the hexadecimal digits. The default is uppercase characters.
            WIDTH
            Set the WIDTH to an integer in the range 0–255 indicating the number of digits in the result.  If the hex representation is smaller than the width, then the result will be padded with 0's at the front. If WIDTH=0 or is not specified, then no zero padding is used.
            Note: If the hex representation is larger than the width, then the result will be filled with asterisks (*) instead of the number.
            IDL_Integer::ToOctal
            The IDL_Integer::ToOctal method returns a string containing the octal value of the number.
            Examples
            Print the octal value of a number:
            num = [65385, 976]
            PRINT, num.ToOctal( ), /IMPLIED
            PRINT, num.ToOctal( WIDTH=8 ), /IMPLIED
            IDL prints:
            177551
            1720
            00177551
            00001720
            Syntax
            Result = var.ToOctal(    [WIDTH=value] )
            Return Value
            A scalar string or string array containing the octal values. If var is an array then the result will be a string array of the same dimensions as the input.
            Arguments
            None.
            Keywords
            WIDTH
            Set the WIDTH to an integer in the range 0–255 indicating the number of digits in the result.  If the octal representation is smaller than the width, then the result will be padded with 0's at the front. If WIDTH=0 or is not specified, then no zero padding is used.
            Note: If the octal representation is larger than the width, then the result will be filled with asterisks (*) instead of the number.
            Version History
            
                
                                 
                    
                        | 8.4 | Introduced | 
                     
                        | 8.6 | Add WIDTH keyword to ToBinary and ToOctal. Add LOWER and WIDTH keywords to ToHex. | 
                 
            
            See Also
            Static Methods and Attributes, Variable Attributes, IDL_Number, IDL_Pointer, IDL_String, IDL_Variable