Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Efficient conversion / interpretation

$
0
0

I need to interpret a 2-element integer(4) array as an integer(8) scaler. Currently I'm using

! One of the next two is a dummy argument
integer(4) :: pos(2)
integer(8) :: cpos

cpos = transfer(pos,cpos)

! or

pos = transfer(cpos,pos)

These two expressions work as expected but I know from experience that transfer can be slow so I was wondering if there is a nifty trick with pointers I could use instead.

Thanks.


Viewing all articles
Browse latest Browse all 5691

Latest Images

Trending Articles



Latest Images

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