ABAP/4 常量定义问题constants c(3) type p decimals 4 value '3.12345'.这样写ok,但是constants c(3) type p decimals 5 value '3.12345'.这样写就崩溃,为什么?

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 10:06:28
ABAP/4 常量定义问题constants c(3) type p decimals 4 value '3.12345'.这样写ok,但是constants c(3) type p decimals 5 value '3.12345'.这样写就崩溃,为什么?

ABAP/4 常量定义问题constants c(3) type p decimals 4 value '3.12345'.这样写ok,但是constants c(3) type p decimals 5 value '3.12345'.这样写就崩溃,为什么?
ABAP/4 常量定义问题
constants c(3) type p decimals 4 value '3.12345'.这样写ok,但是
constants c(3) type p decimals 5 value '3.12345'.这样写就崩溃,为什么?

ABAP/4 常量定义问题constants c(3) type p decimals 4 value '3.12345'.这样写ok,但是constants c(3) type p decimals 5 value '3.12345'.这样写就崩溃,为什么?
下面是我点F1后的帮助中P类型的取值范围的公式:
(-10^(2len -1) +1) / (10^(+dec)) to (+10^(2len -1) -1) /(10^(+dec))
变型一下,整数部分+小数部分
-10^(2len-1-dec) + 10^(-dec) 到 10^(2len-1-dec) - 10^(-dec)
在整数部分的指数中,
len = 3,dec = 4时,2*3-1-4 = 1,存在整数部分;
len = 3,dec = 5时,2*3-1-5 = 0,整数部分指数为0,这样就无意义了.