精度
精度限制,舍入和填零的影响
计算机字由有限的位数组成。这意味着变量的二进制编码只是逼近某一精度的真实值。因此,二进制表示的限制会自动引入对值精度的限制。
主题
- 范围和精度
定点数据类型的范围和精度。
- Maximize Precision
To maximize precision, make the slope as small as possible while keeping the range adequately large.
- 舍入
舍入涉及从高精度到低精度,并产生量化误差和计算噪声。
- 定点 Simulink 模块的舍入模式
定点 Simulink® 模块支持七种不同舍入模式。
- Net Slope and Net Bias Precision
Net slope and bias precision, detecting precision loss, underflow, and overflow.
- Detect Fixed-Point Constant Precision Loss
This example shows how to detect fixed-point constant precision loss.
- Use Scaled Doubles to Avoid Precision Loss
How to avoid precision loss by overriding the data types in your model with scaled doubles.