[Database] ieee754 data type in Oracle

Source: Internet
Author: User

Oracle uses an uncommon number data type to store data. This type uses the BCD code (The hexadecimal 0x99 represents the decimal 99 ). ANSI standard data types, such as integer, float, and double, are aliases of the number data type. Integer data types do not support decimal, float, and double constraints to satisfy integer data types.

The IEEE 754 standard format is the most common format in most computer operating systems and programming designs. The internal format of floating point data is usually stored as 32-bit (floating point type) or 64-bit (double precision type ).

When data is transferred from the database to the development language environment, the data needs to be converted from one format to another. Data conversion may result in loss of data accuracy. Similarly, the process of converting data from one type to another also affects program performance, because a large range of data needs to be converted.

In Oracle 10 Gb, Oracle call interface (Oracle call interface), a column, or PL/SQL variables can all use the binary_float or binary_double data type. In the development environment, such as Java, data types do not need to be converted.

In this process, the speed and accuracy are exchanged. Oracle internal data can accurately store 38 numbers. IEEE 754 floating-point data can only store seven numbers in binary format, and IEEE data also has the problem of "gradual underflow", because binary data is usually repeated numbers. For example, 0.1 is an accurate data in Oracle, but many repeated numbers appear when it is converted to binary.

Scott Stephen has been working in Oracle for 13 years. His research areas include technical support, e-commerce, marketing, and software development.

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.