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: These two integer types are exactly the same as your underlying hardware representation.
SIMPLEINTEGER: it has the same value range as BINARYINTEGER. However, it cannot be NULL and will not throw an exception in case of overflow.
BINARYFLOAT and BINARYDOUBLE: the single-precision, double-precision binary floating point types in the IEEE-754 standard, respectively.
SIMPLEFLOAT and SIMPLEDOUBLE: they have the same scope as BINARYFLOAT and BINARYDOUBLE. However, they are not allowed to be NULL and will not throw an exception in case of overflow, and do not support special direct quantities or predicates.
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)-perscale is the total NUMBER of valid numbers in this value. The range is 1-38-scale, indicating 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 priority ranges from highest to lowest: BINARYDOUBLE, BINARYFLOAT, and 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.

Author: dawei_li

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.