<Example Program>
Program ishft_example Integer,Parameter :: i8 = Selected_Int_Kind(2) Integer(i8) :: a(3) = [ Int(z'f0',i8),Int(z'70',i8),Int(z'0f',i8) ] Do i=-3,3 Print '(I3,3(2X,B8.8))',i,Ishft(a,i) End Do End Program |
|
Execution Results -3 00011110 00001110 00000001 -2 00111100 00011100 00000011 -1 01111000 00111000 00000111 0 11110000 01110000 00001111 1 11100000 11100000 00011110 2 11000000 11000000 00111100 3 10000000 10000000 01111000 |