PersonalCorpus 版 (精华区)
·参数为负数的计算测试
当输入参数为负数时,计算式的结果与计算器结果有出入。经过分析发现
是当加数与被加数补码匹配时负数前面加0ffH,正数加 00H.这样处理后结果正确。
例如:
I: A0= -A98AC7 (FF5639) 十进制: -11111111
A1= -A98AC7 (FF5639) -11111111
A2= A98AC7 11111111
X = 8D041A
X^2= 4DAD84B4D2A4 (40H)
A2*X^2= 3371A886CAB060257C (40H)
A1*X= -5D6426FE3436 (FFFFFFA29BD901CBCA) (50H)
A1*X+A2*X^2=3371A829668961F146 (40H)
A0+A1*X+A2*X^2=3471A8296888B8667F (40H)
II: A0= A98AC7 A1= A98AC7 A3= A98AC7 X= A98AC7
X^2= 4DAD84B4D2A4 (40H)
A2*X^2= 3371A886CAB060257C (40H)
A1*X= 5D6426FE3436
A1*X+A2*X^2= 3371A8E42ED75E59B2
A0+A1*X+A2*X^2= 3371A8E42ED807E479
III: A0= -153158E (FEACEA72) 十进制: -22222222
A1= -153158E (FEACEA72) -22222222
A2= -153158E (FEACEA72) -22222222
X = 8D041A
X^2= 4DAD84B4D2A4 (40H)
A2*X^2= -66E3510D9560C04AF8 (FF991CAEF26A9F3FB508) (40H)
A1*X= -BAC84DFC686C (FF4537B2039794) (50H)
A1*X+A2*X^2= -66E351C85DAEBCB364 (FF991CAE37A51434C9C) (40H)
A0+A1*X+A2*X^2= -66E351C85DB00FC8F2 (FF991CAE37A24FF0370E) (40H)
IV: A0= -BC614E (FF439EB2) 十进制: -12345678
A1= BC614E 12345678
A2= -BC614E (FEACEA72) -12345678
X = 8D041A
X^2= 4DAD84B4D2A4 (40H)
A2*X^2= -3928F3DEF1A35851F8 (FFC6D70C210E5CA7AE08)(40H)
A1*X= 67C49C9D19EC (50H)
A1*X+A2*X^2= -3928F3772D06BB380C (FFC6D70C88D2F944C7F4) (40H)
A0+A1*X+A2*X^2= -3928F3772D0777995A (FFC6D70C88D2F88866A6)(40H)
;
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.170毫秒