ORACLE Number Type detailed

Source: Internet
Author: User
Tags range valid

1>. Number type fine-talk:
Oracle number datatype syntax: number[(precision [, scale])]
Abbreviation: Precision--> P
Scale--> S

Number (P, s)
Range: 1 <= P <=38, -84 <= s <= 127
Save data range: -1.0e-130 <= number Value < 1.0e+126
Stored within the machine range: 1 ~ bytes

Valid: The number of digits from the first number on the left that is not 0.
The case of S:
s > 0
Accurate to the right of the decimal point s bit, and rounded. Then verify that the valid bit is <= p.
S < 0
Accurate to the left of the decimal point, and rounded. Then verify that the valid bit is <= p + S.
s = 0
Number represents an integer at this time.

eg
Actual Data Specified as Stored as
----------------------------------------
123.89 number 123.89
123.89 Number (3) 124
123.89 number (6,2) 123.89
123.89 number (6,1) 123.9
123.89 number (4,2) exceeds precision (valid bit 5, 5 > 4)
123.89 number (6,-2) 100
.01234 number (4,5). 01234 (Valid bit 4)
.00012 number (4,5). 00012
.000127 number (4,5). 00013
.0000012 number (2,7). 0000012
.00000123 number (2,7). 0000012
1.2e-4 # (2,5) 0.00012
1.2e-5 # (2,5) 0.00001
123.2564 number 123.2564
1234.9876 number (6,2) 1234.99
12345.12345 number (6,2) Error (valid bit for 5+2 > 6)
1234.9876 Number (6) 1235 (s does not indicate s=0)
12345.345 number (5,-2) 12300
1234567 number (5,-2) 1234600
12345678 number (5,-2) Error (valid bit 8 > 7)
123456789 number (5,-4) 123460000
1234567890 number (5,-4) Error (Effective bit > 9)
12345.58 Number (*, 1) # 12345.6
0.1 number (4,5) Error (0.10000, valid bit 5 > 4)
0.01234567 number (4,5) 0.01235
0.09999 number (4,5) 0.09999




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.