12.20 Precision Math

12.20.1 Types of Numeric Values
12.20.2 DECIMAL Data Type Characteristics
12.20.3 Expression Handling
12.20.4 Rounding Behavior
12.20.5 Precision Math Examples

MySQL 5.6 provides support for precision math: numeric value handling that results in extremely accurate results and a high degree control over invalid values. 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:

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 5.6 handles numeric operations precisely. For information about controlling the SQL mode, see Section 5.1.7, “Server SQL Modes”.