2 parameter formats, 1 endianness, 2 floating point – PNI FieldForce Trax User Manual
Page 41: Bit floating point (float64), Bit floating point (float32), Parameter formats, Endianness, Floating point
PNI Sensor Corporation
DOC#1016505 r06
TRAX User Manual
Page 37
7.2 Parameter Formats
7.2.1
Endianness
TRAX can treat 32-bit and 16-bit parameters as having big or little Endian formatting.
For 32-bit parameters, the big Endian byte order is ABCD EFGH, while the little Endian
byte order is DCBA HGFE. For 16-bit parameters the big Endian byte order is ABCD,
while the little Endian byte order is DCBA. The Endianness is selectable by the user per
Section 7.4.2. The default is big Endian, and this is generally assumed in the manual.
7.2.2
Floating Point
Floating-point parameters conform to ANSI/IEEE Std 754-1985. A hex-to-floating-point
converter can be found a
that for this converter, little Endian values must be manually converted to big Endian.
Please refer to the Standard for more information. PNI also recommends referencing the
user’s compiler instructions to understand how the compiler implements floating-point.
64-Bit Floating Point (Float64)
Below is the 64-bit float format in big Endian. In little Endian the bytes are in reverse
order in 4-byte groups (e.g. DCBA HGFE).
Exponent
S
Mantissa
63 62
52 51
0
The value (v) is determined as:
v = (-1)S * 2(Exponent-1023) * 1.Mantissa, if and only if 0 < Exponent < 2047
32-Bit Floating Point (Float32)
Shown below is the 32-bit float format in big Endian. In little Endian, the 4 bytes are
in reverse order (e.g. DCBA).
Exponent
S
Mantissa
3130
23 22
0
The value (v) is determined as:
v = (-1)S * 2(Exponent-127) * 1.Mantissa, if and only if 0 < Exponent < 255