12.25 Precision Math精确数学

12.25.1 Types of Numeric Values数值类型
12.25.2 DECIMAL Data Type Characteristics十进制数据类型特征
12.25.3 Expression Handling表达式处理
12.25.4 Rounding Behavior舍入行为
12.25.5 Precision Math Examples精确数学示例

MySQL provides support for precision math: numeric value handling that results in extremely accurate results and a high degree control over invalid values. MySQL提供了对精确数学的支持:数值处理可以产生非常精确的结果,并对无效值进行高度控制。Precision math is based on these two features:精确数学基于以下两个特征:

These features have several implications for numeric operations and provide a high degree of compliance with standard SQL:这些特性对数值运算有多方面的影响,并提供了与标准SQL的高度一致性:

The following discussion covers several aspects of how precision math works, including possible incompatibilities with older applications. 下面的讨论涵盖了精度数学如何工作的几个方面,包括可能与旧应用程序不兼容。At the end, some examples are given that demonstrate how MySQL handles numeric operations precisely. 最后给出了MySQL如何精确处理数值运算的实例。For information about controlling the SQL mode, see Section 5.1.11, “Server SQL Modes”.有关控制SQL模式的信息,请参阅第5.1.11节,“服务器SQL模式”

12.25.1 Types of Numeric Values
12.25.2 DECIMAL Data Type Characteristics
12.25.3 Expression Handling
12.25.4 Rounding Behavior
12.25.5 Precision Math Examples