uint64?
BMangum
It seems the only 64 bit data option using FBinRead is to use 64-bit IEEE floating point:
FBinRead/F=5 refnum, VarName
For now I am getting by reading in only 32 bits at a time - this mostly works as the parameter of interest is often small enough that it can be represented by only 32 bits.
Is there a way to simply read in the 64 bit unsigned integer at once?
Alternatively, is there a way to combine two 32 bit integers into a single 64 bit integer?
No. Igor has no 64-bit integer data type. I think we should add it in a future version but it is not a simple matter for a number of reasons, one of which is backward compatibility. Another is the fact that internally Igor stores all variables in double-precision floating point which is not sufficient to represent the entire range of a 64-bit integer.
A double can represent 53 bits precisely and that is more than enough for most applications.
Yes. Something like this for unsigned data:
FBinRead /F=3/U refnum, lowWord // Assume data is little-endian
FBinRead /F=3/U refnum, highWord
Variable result = lowWord + 2^32*highWord
Signed would be more complicated.
October 19, 2011 at 06:10 pm - Permalink
FBinRead /F=3/U refnum, lowWord // Assume data is little-endian
FBinRead /F=3/U refnum, highWord
Variable result = lowWord + 2^32*highWord
This will work - thanks!
October 20, 2011 at 07:43 am - Permalink