1: /* function igetbt fortran callable for integer*2. PLW 8/5/79*/ 2: /* For integer x, return right shifted the n bits counting from 3: low to high and beginning at p where the lowest order bit is 4: 0 and an integer is 15 bits plus the sign bit. */ 5: int h_getbit(x,p,n) 6: unsigned int *x,*p,*n; 7: { 8: unsigned int r; 9: r=~(~0 << *n); 10: return((((r << *p) & *x) >> *p) & r); 11: }