Re: Binary floating point format
Re: Binary floating point format
- Subject: Re: Binary floating point format
- From: Greg Parker <email@hidden>
- Date: Thu, 30 Mar 2017 19:04:12 -0700
> On Mar 30, 2017, at 6:40 PM, Steve Bird <email@hidden> wrote:
>
>> On Mar 30, 2017, at 8:25 PM, Carl Hoefs <email@hidden> wrote:
>>
>> I have megabytes of raw legacy science datasets that I'm trying to read into my app and ingest into an array of doubles. The data is supposed to be organized as a stream of 8-byte doubles. I do not know how these datasets were generated, so I don't know what format (big/little endian, byte swapped, etc) they are in.
>> Here is a hex dump of 4 binary doubles:
>>
>> 49BF7DE372533C05 A8C02FE3135B4F09 86C22FE37E630B05 27C2C4E3E258BA08
>
> A few minutes of LabVIEW work shows some semi-reasonable values if you swap bytes:
> BF49E37D5372053C = -0.000790058
> C0A8E32F5B13094F = -3185.59
>
> Do you know that those values are wrong?
Alternating byte-swapping is a good hint that you're looking at a PDP-11 / VAX format. There are two different 64-bit VAX formats, though, and neither is identical to IEEE even after correcting for the byte order. Simply shuffling VAX bytes and interpreting as an IEEE double would be misleadingly close but still wrong.
--
Greg Parker email@hidden <mailto:email@hidden> Runtime Wrangler
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden