加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

精度和比例在Oracle NUMBER数据类型中意味着什么

发布时间:2020-12-12 16:30:11 所属栏目:百科 来源:网络整理
导读:我一直在阅读oracle DB的初学者指南.精度和规模的定义非常混乱. 书说: number(6,3) Oracle allows for 2 not 6 significant digitalis. 我的问题是,6意味着精确.这意味着有效位数.所以它应该接受6位有效数字.为什么这本书说这是2位有效数字 我所指的那本书
我一直在阅读oracle DB的初学者指南.精度和规模的定义非常混乱.
书说:
number(6,3) 

Oracle allows for 2 not 6 significant digitalis.

我的问题是,6意味着精确.这意味着有效位数.所以它应该接受6位有效数字.为什么这本书说这是2位有效数字

我所指的那本书是Oracle Database 11g A Beginner’s Guide by McGraw Hill Professional,Dec 18,2008,第12页

查看在线Oracle doc:

p is the precision,or the maximum number of significant decimal
digits,where the most significant digit is the left-most nonzero
digit,and the least significant digit is the right-most known digit.
Oracle guarantees the portability of numbers with precision of up to
20 base-100 digits,which is equivalent to 39 or 40 decimal digits
depending on the position of the decimal point.

s is the scale,or the number of digits from the decimal point to the
least significant digit. The scale can range from -84 to 127.

Positive scale is the number of significant digits to the right of the
decimal point to and including the least significant digit.

Negative scale is the number of significant digits to the left of the decimal point,to but not including the least significant digit. For negative scale the least significant digit is on the left side of the decimal point,because the actual data is rounded to the specified number of places to the left of the decimal point. For example,a specification of (10,-2) means to round to hundreds.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读