Is number(15) an integer?

duanduan630 注册会员
2023-02-28 05:11

NUMBER(precision,scale) Where precision represents the significant bits in a number(counting from the first non-zero number on the left, not counting decimals and negatives)
scale represents the number of accurate bits
number(15) can be viewed as a 15-bit integer

chenyb0513 注册会员
2023-02-28 05:11

number(15), is an integer, no decimal point... number contains all number types

dzg8619 注册会员
2023-02-28 05:11

NUMBER(15) is a numeric data type, indicating that 15 digits(including decimal places) can be stored. This type can store integers, decimals, and negative numbers.

Because NUMBER(15) can store decimals, it does not necessarily represent integers. If you want to restrict the NUMBER field to integers, use NUMBER(p, 0) to denote the NUMBER type of precision 0.

duxinjian44 注册会员
2023-02-28 05:11

number(15), indicating that this field can store up to 15 digits, but no decimal number is specified. Therefore, this field can store integers and decimals, and contains up to 15 digits.

zongcailala 注册会员
2023-02-28 05:11

The NUMBER data type in Oracle can store numbers of any precision, including integer, decimal, positive, negative, and so on. When creating a table, you can specify the precision and NUMBER of decimal places for the number. For example, NUMBER(15,2) represents a numeric type with a maximum precision of 15 and two decimal places.

Therefore, if the field type you define in Oracle is NUMBER(15), you can store 15 digits, including integers and decimals. If the number of decimal places is not specified, the default value is 0, indicating that an integer is stored. Therefore, NUMBER(15) can store 15-bit integers.

darcula_x 注册会员
2023-02-28 05:11

This answer quotes ChatGPT

In Oracle, the field type NUMBER(n) represents a number that can store up to n digits, where n is the total number of digits, including the decimal point and the sign bit. If n is not specified, it means that any number of digits can be stored.

Thus, NUMBER(15) does not represent an integer, but a number that can store up to 15 digits, including decimals and sign bits. If you want to represent integers, you can use NUMBER(n,0) to define a numeric type that does not contain decimal places, where n is the largest digit.

In Java, you can use the BigDecimal class to represent numbers of arbitrary precision, including integers and decimals. When using BigDecimal, you can specify precision and rounding rules to suit your needs. When performing database operations, you can use the JDBC API to read and write the NUMBER type fields in the database. When reading the NUMBER field, you can use the ResultSet.getBigDecimal method to get an object of type BigDecimal for subsequent computation and processing.

sync3939 注册会员
2023-02-28 05:11

number(15) indicates a numeric type in Oracle that can store up to 15 digits in total, with up to 38 decimal places. This field can store either an integer or a numeric value with a decimal. Whether it is an integer depends on the data storage.