The scope of precision math for exact-value operations includes the exact-value data types (integer and 精确值运算的精确数学范围包括精确值数据类型(整数和DECIMAL
types) and exact-value numeric literals. DECIMAL
类型)和精确值数字文字。Approximate-value data types and numeric literals are handled as floating-point numbers.近似值数据类型和数字文字作为浮点数处理。
Exact-value numeric literals have an integer part or fractional part, or both. 精确值数字文字有整数部分或小数部分,或两者兼有。They may be signed. 可以签字。Examples: 例如:1
, .2
, 3.4
, -5
, -6.78
, +9.10
.1
、.2
、3.4
、-5
、-6.78
、+9.10
。
Approximate-value numeric literals are represented in scientific notation with a mantissa and exponent. 近似值数字文字用带有尾数和指数的科学记数法表示。Either or both parts may be signed. 一方或双方均可签字。Examples: 示例:1.2E3
, 1.2E-3
, -1.2E3
, -1.2E-3
.1.2E3
、1.2E-3
、-1.2E3
、-1.2E-3
。
Two numbers that look similar may be treated differently. 两个看起来相似的数字可能会被区别对待。For example, 例如,2.34
is an exact-value (fixed-point) number, whereas 2.34E0
is an approximate-value (floating-point) number.2.34
是精确值(定点)数,而2.34E0
是近似值(浮点)数。
The DECIMAL
data type is a fixed-point type and calculations are exact. DECIMAL
数据类型是定点类型,计算是精确的。In MySQL, the 在MySQL中,DECIMAL
type has several synonyms: NUMERIC
, DEC
, FIXED
. DECIMAL
类型有几个同义词:NUMERIC
、DEC
、FIXED
。The integer types also are exact-value types.整数类型也是精确值类型。
The FLOAT
and DOUBLE
data types are floating-point types and calculations are approximate. FLOAT
和DOUBLE
数据类型是浮点类型,计算是近似的。In MySQL, types that are synonymous with 在MySQL中,与FLOAT
or DOUBLE
are DOUBLE PRECISION
and REAL
.FLOAT
或DOUBLE
同义的类型是DOUBLE PRECISION
和REAL
。