Oracle SQL Developer
Oracle SQL Developer
Oracle SQL Developer
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Storing Numeric DataThe absence of precision and scale designators specifies the maximum range andprecision for an <strong>Oracle</strong> number.Table 5–1 show how <strong>Oracle</strong> stores data using different values for precision and scale.Table 5–1Storage of Scale and PrecisionActual Data Specified As Stored As123.89 NUMBER 123.89123.89 NUMBER(3) 124123.89 NUMBER(6,2) 123.89123.89 NUMBER(6,1) 123.9123.89 NUMBER(3) exceeds precision123.89 NUMBER(4,2) exceeds precision123.89 NUMBER(6,-2) 100.01234 NUMBER(4,5) .01234.00012 NUMBER(4,5) .00012.000127 NUMBER(4,5) .00013.0000012 NUMBER(2,7) .0000012.00000123 NUMBER(2,7) .00000121.2e-4 NUMBER(2,5) 0.000121.2e-5 NUMBER(2,5) 0.000015.3.3 Using Floating-Point Number FormatsThe BINARY_FLOAT and BINARY_DOUBLE data types store floating-point data in the32-bit IEEE 754 format and the double precision 64-bit IEEE 754 format respectively.Compared to the <strong>Oracle</strong> NUMBER data type, arithmetic operations on floating-pointdata are usually faster for BINARY_FLOAT and BINARY_DOUBLE. Also, high-precisionvalues require less space when stored as BINARY_FLOAT and BINARY_DOUBLE.The floating-point number system is a common way of representing and manipulatingnumeric values in computer systems. The value 4.32682E-21F is an example of aBINARY_FLOAT data type.Floating-point numbers can have a decimal point anywhere from the first to the lastdigit or can have no decimal point at all. An exponent may optionally be usedfollowing the number to increase the range (for example, 1.777 e -20 ). A scale value isnot applicable to floating-point numbers, because the number of digits that can appearafter the decimal point is not restricted.Binary floating-point numbers differ from NUMBER in the way the values are storedinternally by <strong>Oracle</strong> Database. Values are stored using decimal precision for NUMBER.All literals that are within the range and precision supported by NUMBER are storedexactly as NUMBER. Literals are stored exactly because literals are expressed usingdecimal precision (the digits 0 through 9). Binary floating-point numbers are storedusing binary precision (the digits 0 and 1). Such a storage scheme cannot represent allvalues using decimal precision exactly. Frequently, the error that occurs whenconverting a value from decimal to binary precision is undone when the value isconverted back from binary to decimal precision. The literal 0.1 is such an example.5-4 <strong>SQL</strong> <strong>Developer</strong> Online Help