01-20-2008 01:38 AM
ecc83 wrote:
As for the endian format, I have set the read binary when reading the 10 bytes
for both big and little endian, and there was no difference....go figure.
01-20-2008 02:22 AM
01-20-2008 03:22 PM
01-20-2008 03:37 PM
01-20-2008 04:09 PM
01-23-2008 03:43 AM
Hi Gary,
I haven't given-up yet - have you? Came accross the following snippet. Its very interesting because the exponent appears last, in a 10-byte sequence - treated as 5 Word (2-byte) pairs. Another interesting thing is that the bit-pattern of LabVIEWs mantissa - for 2200 - with "hidden 1" added-back is:
100010011000 (Exp = 11),
and the most significant bits, starting with first non-zero, when representing your data:
100010001110
Interesting, since we're not expecting exactly 2200...
Still, 184 and 30 are hard to interpret as an exponent - even after subtracting an extended-precision "bias" of 16387, With a 15-bit exponent, we really want to see a 0x40 (0r 0xB0) for one of the exponent bytes, else the exponent starts to look crazy, so the hunt continues...
I came across a couple of links (like this one) that refer to a "double-extended" format using a minimum of 79 bits which may yet describe your data.
Cheers.
01-24-2008 04:39 AM
Here's a VI that produces 2190.70 from your data by scaling each byte according to its position in the input array. In other words, it doesn't treat the array as representing an "IEEE" float - so this VI is just a curiosity.
I don't think Delphi is "freak"ish because it uses a 10-byte format - 10 bytes seems to be the standard for "Extended" precision, though "Extended" precision wasn't defined well in IEEE-related docs I managed to find. "The Intel Microprocessors" Third Edition, by Barry B Brey (copyright 1994) describes the 10-byte format as a "temporary form" used by processors to help retain precision while doing single and double-precision math. This "Extended" format uses an explicit "1" bit in the MSBit of the mantissa and many descriptions of "Extended Precision" found on the web describe it, but LabVIEW is different...
LabVIEW employs the "hidden" '1' format (as is proper for SGLs and DBLs.) It makes sense because the "temporary" Extended of old - with fixed '1' in the Mantissa - wasn't designed to be used by the programmer, but LabVIEW's Extended Precision is. Now, I wonder if LabVIEW employs it's own "Extended Extended" precision, behind the scenes, to maintain precision during Extended computations - could be that's what the extra 6 bytes are for...
If your data really represents the bits of a float - complete with sign, exponent and mantissa sections - then it's probably possible to massage the bits and turn them into a LabVIEW Extended precision float. But it's been difficult to find the Exponent bits in the data so-far presented! Can you share a few more records?
Cheers!
01-24-2008 05:02 AM
When LV supported Solaris, it needed a 128 bit representation because it was supported there and it probably just stayed around for compatibilty (and byte alignment?). I'm assuming that LV simply uses the built-in extended mode of the processor and any data which LV has which is above its level of resolution is ignored. You might wish to read this.
tbd wrote:
Now, I wonder if LabVIEW employs it's own "Extended Extended" precision, behind the scenes, to maintain precision during Extended computations - could be that's what the extra 6 bytes are for...
01-24-2008 11:18 PM
Perhaps you could learn something too, tst.
In the following post-script file, W. Kahan describes that IEEE-754 extendeds don't employ the hidden 1 for historical reasons - LabVIEW does employ hidden 1, so if there's such a thing as IEEE-754 compliant, LabVIEW's EXTs arent, exactly.
www.cs.berkeley.edu/~wkahan/ieee754status/ieee754.ps
In the following pdf from Intel, it describes the three FP types of their FPU - the "extended real" type uses an explicit "integer" in the MSBit of the mantissa - unlike LabVIEW.
http://developer.intel.com/design/pentium/manuals/24319001.pdf
I don't know what format Brian meant when he said "LabVIEW uses an extended precision" FP and uses "an extended format internally". I don't think he said LabVIEW uses precisely the same format as the FPU - just that NI uses the FPU in its extended mode when processing LabVIEW's EXTs.
Regardless of what Brian said or meant, LabVIEW's EXT doesn't comply with the description for IEEE-754 "Extended precision" or Intel FPU "Extended Real"
(... perhaps Delphi's 10-byte extended did. )
01-25-2008 05:18 AM
I definitely could, but I'm probably not going to, because it's right at about this point that I enter "boring class mode" (glazed-over eyes, music running through my head, etc.). You've pretty much got everything I know about the subject in my last post.
tbd wrote:
Perhaps you could learn something too, tst.