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

forming a 64 bit integer from two 32 bit integers

$
0
0

I try to read some data from a binary file written in the form of four 32 bits unsigned integers, iSub(0:3). One of the parameters need to be extracted has a length of 48 bits. It is defined in my code as Integer(kind=8); Int8. According to the documentation the low bits of Int8 are in bytes 0:31 of iSub(1) and bytes 32:47 are in bytes 0:15 of iSub(2).

 I use the following code:

Int8 = ISHFT(( iSub(2)  .AND. #FFFF),32) + iSub(1)

This works correctly, until iSub(1) reaching the maximum size of an Integer(kind=4).

 

Any recommendation how to overcome this limitation?

 

Tibor


Viewing all articles
Browse latest Browse all 5691

Trending Articles



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