home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / more / code_examples / librar / ltestbit.c < prev    next >
Text File  |  1989-02-08  |  512b  |  20 lines

  1. /*--------------------------------------*/
  2. /*                    */
  3. /*            LTESTBIT(X,X)        */
  4. /*                    */
  5. /* Bit tests a long integer.  The first */
  6. /* argument is the long integer being    */
  7. /* tested.  The second argument is the    */
  8. /* bit to be tested.  The function    */
  9. /* returns a -1 if the bit is on or a    */
  10. /* zero otherwise.            */
  11. /*                    */
  12. /*--------------------------------------*/
  13. ltestbit(h,a)
  14. long h;
  15. int a;
  16. {
  17.     int d;
  18.     d=(h<<(31-a))>>31;
  19.     return(d);
  20. }