Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

精度

精度限制,舍入和填零的影响

计算机字由有限的位数组成。这意味着变量的二进制编码只是逼近某一精度的真实值。因此,二进制表示的限制会自动引入对值精度的限制。

主题

Range and Precision

The range of a number gives the limits of the representation, while the precision gives the distance between successive numbers in the representation. The range and precision of a fixed-point number depend on the length of the word and the scaling.

Maximize Precision

To maximize precision, make the slope as small as possible while keeping the range adequately large.

Rounding

Rounding involves going from high precision to lower precision and produces quantization errors and computational noise.

Rounding Modes for Fixed-Point Simulink Blocks

Fixed-point Simulink® blocks support seven different rounding modes.

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.

特色示例