Spec-Zone .ru
спецификации, руководства, описания, API

12.19. Precision Math

12.19.1. Types of Numeric Values
12.19.2. DECIMAL Data Type Changes
12.19.3. Expression Handling
12.19.4. Rounding Behavior
12.19.5. Precision Math Examples

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