JL Computer Consultancy
数据是如何存储的。
select dump({number},10) from dual; -- decimal dump
select dump({number},16) from dual; -- hex dump
步骤一 精度部分:
如果内部数字以102(Hex 0X66)结尾
他是负数
丢弃最后的数字102
用101减去从第二个到倒数第二个的数字
else
他是正数
从倒数第二个到最后一个数字,全部减一
步骤二 scale:
如果数字是负的
第一个数字减去62,然后是100的次方,再与别的数字相乘
如果是正的:
第一个数字减去193,然后100的次方,再与别的数字相乘
Example 1:
c3 2 2e = 195 2 46
The number is positive (doesn't end in 102 / 0x66)
(2,46) --> 01 45 --> 1.45
195 = 193 + 2 --> multiply by 100 twice
Answer 14,500
Example 2:
be 2e 3d = 190 46 61
The number is positive
(46, 61) --> 45 60 --> 45.60
190 = 193 - 3 --> negative so divide by 100 three times
Answer 0.0000456
Example 3:
40 1c 3d 66 = 64 28 61 102
The number is negative (ends in 102 / 0x66)
(28, 61) --> 73 40 --> 73.40 (101 - 28 = 73 etc.)
64 = 62 + 2 --> divide by 100 two times
Answer -0.00734
Example 4:
3c 5d 8 25 43 66 = 60 93 8 37 67 102
The number is negative
(93, 8, 37, 67) --> 8 93 64 34 --> 8.936434
60 = 62 - 2 --> negative so multiple by 100 twice
Answer -89364.34
转自
阅读(2096) | 评论(0) | 转发(0) |