A floating point parameter is a number that does not have a fixed decimal point location. The DeltaV system uses a standard IEEE, single precision, 32-bit floating point format. This format includes an overall sign bit, a signed exponent portion, and a mantissa portion. The exponent portion is applied to the base 2 and uses eight bits (seven bits and a sign bit). The mantissa, which is 23 bits, graduates the range determined by the exponent and establishes the resolution of the floating point number. The overall sign bit makes up the 32 bits.
From the above, it is evident that floating point numbers are represented by a finite number of bits. This implies that there is a minimum/maximum size for these numbers and that the number of significant digits that can be resolved is limited. The larger the number being stored, the poorer the resolution. In other words, the result of a mathematical operation involving floating point numbers would not be completely precise if one of the numbers was significantly larger than the other.
If a comparison involves a floating point number, it is recommended not to use the equals (=) operator because differences caused by rounding may occur, preventing the compared values from matching.
The 8-bit exponent allows a number between -2^128 and +2^128 (-3.4E38 and +3.4E38) to be represented. The mantissa determines the resolution of the number. With a mantissa of 23 bits, the resolution is 1/8,388,608 (1/(2^23)). This translates to seven significant decimal digits.
Floating point numbers in the DeltaV system have the following limits:
Maximum negative: |
-3.4E38 |
Minimum negative: |
-2.34E-39 |
Minimum positive: |
+2.34E-39 |
Maximum positive: |
+3.4E38 |
Mathematical operations resulting in numbers that exceed these limits will result in the limit value (for example, 3.4E38 + 100 = 3.4E38).
As data is converted to and from floating point (for example, floating point to integer), it is possible for very small inaccuracies to arise. Floating point numbers can be relied on up to 6 significant digits when converting. For example, a number that is originally entered as 121.1 could be converted to 121.099998. The error introduced by the conversions is not significant in most cases. When converting from floating point to integer, there is a floor of .99999 and a ceiling of .999999 for how the conversion will occur. For example, a float that is 128.99999 converts to the integer 128. A float that is 128.999999 converts to the integer 129.