BINARY
This function is used to display a binary representation of byte, integer, and long integer values.
FANNING SOFTWARE CONSULTING David Fanning, Ph.D. 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: david@idlcoyote.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Utilities
output = Binary(theNumber)
output: A string array of 0s and 1s to be printed (normally), in a binary representation of the number. The number is represented with the highest bits on the left and the lowest bits on the right, when printed with the PRINT command.
theNumber: The number for which the user wants a binary representation. It must be BYTE, INT, or LONG.
COLOR: If this keyword is set, the binary representation always contains 24 bits of output. SEPARATE: If this keyword is set, the output is separated with space between each group of eight bits.
IDL> Print, Binary(24B) 0 0 0 1 1 0 0 0 IDL> Print, Binary(24L) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 IDL> Print, Binary(24L, /COLOR) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 IDL> Print, Binary(24L, /COLOR, /SEPARATE) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0
Written by: David W. Fanning, November 10, 2007. Fixed a problem with error handling. 13 March 2008. DWF.