Using fixed-point variables

For target systems that do not include floating-point capabilities, IBM® Rational® Rhapsody® Developer for C provides an option to use fixed-point variables.

This option is done by scaling integer variables so that they can represent non-integral values. The product uses the 2 factorial approach to achieve this option. For example, setting the bit that typically represents 2^0 to represent 2^-3 (.125).

For each such variable, the user specifies the word-size and the precision of the variable. The specific steps involved are described in Defining fixed-point variables.


Feedback