What is the difference between number and binary_double in Oracle?

Source: Internet
Author: User

What is the difference between number and binary_double in Oracle?

The main advantage is: it is more efficient than number, faster, and takes less space, but the version compatibility is poor.

Numeric numeric type

  • Number: this is a real decimal data type. It is also the only numeric type in PL/SQL that is fully platform-independent.
  • PlsInteger and binaryInteger: The two integer types are exactly the same as the underlying hardware representation.
  • SimpleInteger: it and binaryInteger has the same value range, but cannot be null, and no exception is thrown in case of overflow.
  • BinaryFloat and binaryDouble: the two are single-precision, double-precision binary floating point types in the IEEE-754 standard respectively.
  • SimpleFloat and simpleDouble: They and binaryFloat and binaryDouble has the same gathering range, but it cannot be null. In case of overflow, no exception is thrown, and special direct quantities or predicates are not supported.

Number:

Oracle databases allocate a maximum of 40 numbers to empty orders, and the decimal point is also optimized based on the value given to the variable. The value range is 1.0e-130 to 1.0e126-1. A value smaller than the minimum value is rounded down to 0. If the value of the calculation result is greater than the maximum value, undefined is triggered, resulting in a running error but no exception is thrown.

Number (precision, scale)-permissionis the total number of valid numbers in this value. The range is 1-38-scale, indicating the number of digits on the right (positive scale) or left (negative scale) of the decimal point. Range:-84-127

 

Binary_float and binary_double types

Oracle has a mandatory priority for implicit conversions of floating point types. The highest to lowest priority is binary.Double, binaryFloat, number

**************************************** **************************************** **

Rounding and truncation Functions

  • Cell: returns the smallest integer greater than or equal to the specified value.
  • Floor: returns the maximum integer that is less than or equal to the specified value.
  • Found: rounds a number.
  • Trunc: truncates a number by a specified number of decimal places.

 

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.