A.3. Approximate Numeric Datatypes


Approximate numeric datatypes store floating-point numbers like fractions where an approximation must be made. For instance, an accurate number, per se, cannot be stored for 1/3, because the decimal point for 3 continues on endlessly. Table A-2 lists approximate numeric datatypes. There are synonyms for a few of these types. DOUBLE and REAL are synonyms for DOUBLE PRECISION. However, if the SQL mode for the server has the REAL_AS_FLOAT option enabled, REAL is a synonym for FLOAT. For FLOAT, a level of precision may be specified. It may be from 0 to 24 for single-precision floating-point numbers and from 25 to 53 for double-precision floating-point numbers. If a precision isn't given with FLOAT, a single-precision floating point is assumed. With DOUBLE, if UNSIGNED is specified, negative values are not allowed.

Table A-2. Approximate numeric datatypes

FLOAT(precision) [UNSIGNED] [ZEROFILL]

FLOAT[(width,digits)] [UNSIGNED] [ZEROFILL]

 

-3.402823466E+38 to -1.175494351E-38

 

0

 

1.175494351E-38 to 3.402823466E+38

DOUBLE PRECISION[(width,digits)] [UNSIGNED] [ZEROFILL]

 

-3.402823466E+38 to -1.175494351E-38

 

0

1.175494351E-38 to 3.402823466E+38




MySQL in a Nutshell
MYSQL in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596514336
EAN: 2147483647
Year: 2006
Pages: 134
Authors: Russell Dyer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net