1: /*ISHFT fortran callable. PLW 8/7/79.*/ 2: /* For integer x shift by amount y. 3: y >0 shift left, right fill with 0 4: y =0 no shift 5: y <0 shift right, left fill with 0's even if sign 6: bit is on */ 7: long int i_ishft(x,y) 8: long int *x,*y; 9: { 10: if (*y > 0) 11: return (*x << *y); 12: else if (*y < 0) 13: return ((*x >>(-*y)) & (~(~0 << (32 + *y)))); 14: else 15: return (*x); 16: }