October 20th, 2008

DOUBLE PRECISION Data

Posted by admin in F. Data Types

Computer systems use internal registers to performs math functions.
These registers are typically 32-bit, 64-bit, 128-bit, or 256-bit in length.
DOUBLE PRECISION gives a double-precision floating-point number (the size of two registers).

> The actual precision of DOUBLE PRECISION depends on the RDBMS vendor’s implementation.

> Since it is a floating-point number expressed in scientific notation, it is an approximate number and may not be accurate to the last digit.

> It can be negative, zero, or positive.

> If you have a choice between exact (DECIMAL or NUMERIC) or approximate (FLOAT, REAL, or DOUBLE PRECISION), use the exact data type because you get completely accurate numbers and it processes faster.

> SQL:2003 introduced REAL, DOUBLE PRECISION, and FLOAT(precisionbits) data types.
> Approximate data type should be used only for very extreme ranges of numeric values.

October 17th, 2008

REAL Data

Posted by admin in F. Data Types

Computer systems use internal registers to performs math functions.
These registers are typically 32-bit, 64-bit, 128-bit, or 256-bit in length.
REAL gives a single-precision floating-point number (the size of one register).

> The actual precision of REAL depends on the RDBMS vendor’s implementation.

> Since it is a floating-point number expressed in scientific notation, it is an approximate number and may not be accurate to the last digit.

> It can be negative, zero, or positive.

> If you have a choice between exact (DECIMAL or NUMERIC) or approximate (FLOAT, REAL, or DOUBLE PRECISION), use the exact data type because you get completely accurate numbers and it processes faster.

> SQL:2003 introduced REAL, DOUBLE PRECISION, and FLOAT(precisionbits) data types.
> Approximate data type should be used only for very extreme ranges of numeric values.

October 16th, 2008

FLOAT(precisionbits) Data

Posted by admin in F. Data Types

FLOAT is a floating point number expressed in scientific notation. It is a decimal number multiplied by an integer power of 10. For example: 4.5E2 = 4.5 x 10 = 450. The mantissa (coefficient) is the portion that expresses the significant digits (here it’s 4.5). An upper case E is the symbol for the exponent (here it’s 2 for 10 to the 2nd power). The mantissa and exponent can also be negative. For example: -4.5E-2 = -4.5 x 10 = -0.045.

Example:    COL1 FLOAT(24)

COL1 can have the precision of 24 bits or ten million significant digits.

Definition  Possible Values                    Example
FLOAT(12)    12 bits or 3 significant digits   3.14E2 = 314
FLOAT(24)    24 bits or 7 significant digits   5.280796E0 = 5.280796
FLOAT(34)    34 bits or 10 significant digits  3.297249382E-3 = 0.003297249382
FLOAT(50)    50 bits or 15 significant digits  1.45732792216439E11
FLOAT(100)  100 bits or 30 significant digits

> Multiply the bits precision by 0.30103 to get the decimal precision.
> Multiply the decimal precision by 3.32193 to get the binary precision.
> For most RDBMS systems the range is -5.4E-79 to +7.2E+75.
> If precisionbits is 1 to 21, then the column value is 5 bytes long.
    If precisionbits is 22 to 53, then the column value is 9 bytes long.

« Previous PageNext Page »