Quantcast
Viewing all articles
Browse latest Browse all 3270

Issue with dshiftl and dshiftr

Consider the following fortran 2008 program.

program foo
  integer(kind=8) i,j
  i = z'1111111111111111'
  j = z'4444444444444444'
  do n=0,64
    print "(i2,': ',z16,2x,z16)",n,dshiftl(i,j,n),dshiftr(i,j,n)
  end do
end program foo

 

When compiled with Intel Fortran Compiler 14.0.3.174 build 20140422 or 15.0.2.164 build 20150121, it produces the incorrect output for n=0 and n=64,

 0: 5555555555555555  5555555555555555
...
64: 5555555555555555  5555555555555555

It should produce

 0: 1111111111111111  4444444444444444
...
64: 4444444444444444  1111111111111111

This was run on a RHEL 6.6 computer with a haswell processor.


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>