Stateflow | ![]() ![]() |
How Stateflow Implements Fixed-Point Data
The preceding example in Fixed-Point Arithmetic does not answer the question of how the values for the slope, , the quantized integer,
, and the bias,
, are implemented in Stateflow as integers. These values are implemented through the following:
uint8
, uint16
, and uint32
, and the signed integer types int8
, int16
, and int32
. For specific instructions on how to enter fixed-point data, see Specifying Fixed-Point Data in Stateflow.
Notice that if a fixed-point number has a slope and a bias
, it is equivalent to its quantized integer
, and behaves exactly as its base integer type.
Stateflow provides a special assignment operator (:=
) and context-sensitive constants to help you maintain as much precision as possible in your fixed-point operations. See Assignment (=, :=) and Cast Operations and Fixed-Point Context-Sensitive Constants.
![]() | Fixed-Point Arithmetic | Specifying Fixed-Point Data in Stateflow | ![]() |