The <float> element defines a 32 bit single precision floating point number. This is the standard floating point number representation used on all modern computer architectures.
| Attributes |
|
The following XDDL file describes a message with one float value.
<xddl>
<structure>
<field name="uint" length="32"/>
<float name="float"/>
</structure>
</xddl>
float.xddl
Decoding a message with the number 40.875:
# idm float.xddl 4223800042238000
Name Length Value Hex Description
uint 32 1109622784 42238000
float 32 40.875 42238000
As you can see, using <float> just tells the IDM to interpret the bit pattern as a float instead of an unsigned integer.
Notice there is no length field to the <float> element. The length is
fixed at 32 bits.
The optional type attribute may reference a <type>
element, just like the <field> element. However, the type must be
formatted. <enum> types will be ignored.