简体   繁体   中英

How to convert DEC 64bit double precision floating point to IEEE-754 (DEC is not decimal)

To clarify here DEC in this case is Digital Equipment Corporation NOT decimal. What I have is a binary representation of DEC with seeeeeeeefffff....(total f's is 54) s = sign bit, e = exponent, f = fraction and I need to convert that into an IEEE-754 format preferably with the same precision. To put into context this represents a utc time tag for gps. I have become increasingly confused on the terminolgy as I have found multiple names that might represent DEC and might not. For example VAX-ll, DEC64, PDP-11 and I've tried all of them without much success.

Here is the raw data (in hex) that represents a UTC time tag in DEC dpfp for reference and what its approx. supposed to be: (keep in mind this data is LITTLE ENDIAN and IEEE-754 should be big endian)

0x99, 0x48, 0xD9, 0xE4, 0x12, 0xF3, 0xF9, 0xF0 = 1608587778

I believe PDP-11 or VAX to be more likely

You may find the package libvaxdata 1 does what you need. I haven't used it but it claims to offer routines to convert between IEEE and VAX floating point types. (It can be used for PDP-11 data as well). There is a document describing the routines.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM