home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 1
/
FishNMoreVol1.bin
/
more
/
code_examples
/
librar
/
testbit.c
< prev
next >
Wrap
Text File
|
1989-02-08
|
542b
|
25 lines
/*--------------------------------------*/
/* */
/* TESTBIT(X,X) */
/* */
/* Functionality: */
/* Checks a bit in an integer to */
/* see if it's on or off. */
/* Arguments: */
/* 0: The integer to be used. */
/* 1: The bit to be tested. */
/* Returns: 0: If bit is off */
/* -1: If bit is on */
/* Author: John Callicotte */
/* Date created/modified: 09/01/88 */
/* */
/*--------------------------------------*/
testbit(h,a)
int a,h;
{
int d;
d=(h<<(15-a))>>15;
return(d);
}