1: /* function igetbt fortran callable for integer*4. 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 31 bits plus the sign bit. */ 5: long int i_getbit(x,p,n) 6: long int *x,*p,*n; 7: { 8: long int r; 9: if (*n == 32) r=~0; 10: else r=~(~0 << *n); 11: return((((r << *p) & *x) >> *p) & r); 12: }