Coyote Graphics Routines

Date: Fri Mar 27 12:14:20 2015

single page | use frames     summary     class     fields     routine details     file attributes


top cgBitGet


result = cgBitGet(number, bit [, /SILENT])

The program is used to obtain the value of a particular bit in an integer number.

Return value

The function returns the bit value (0 or 1) of a specified bit in a supplied number.


number in required type=integer

The number from which the bit value is obtained. It should be a scalar integer. If it is not, it is converted to a scalar integer by rounding.

bit in required type=integer

The number of the bit you are interested in. A value between 0 and 63. If not supplied, all 64 bit values of the number are returned. May be an array of bit numbers.


SILENT in optional type=boolean default=0

If set, suppresses informational messages regarding rounding operations.


Here is how to use this program:

IDL> !X.Style = 5 IDL> Print, cgBitGet(!X.Style, 2) 1

Author information



David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: Coyote's Guide to IDL Programming:


Copyright (c) 2006-2014, Fanning Software Consulting, Inc.


Change History:

Written by David W. Fanning, 14 June 2006.

File attributes

Modification date: Fri Mar 27 11:07:36 2015
Lines: 129
Docformat: rst rst