P******d 发帖数: 137 | 1 I am trying to convert 19 digits decimal number into hexdecimal. Here is my
code. However, the last 2-3 digits of converted hex number are 0, which is
not correct.(The right hex number should be 40000104A027F1A6, however the
result given by the code is 40000104A027F000) Can anyone help on this?
Thanks a lot.
DATA test;
INPUT ID $19.;
CARDS;
4611687137805857190
;
run;
data test1;
set test;
length hex $16. hexx1-hexx16 $1.;
array hx {*} hex1-hex16;
array hxx{*} hexx1-hexx16;
res=input(id,19.);
hex='';
do i=1 to 16;
hx{i}=int(res/16**(16-i));
res=res-hx{i}*16**(16-i);
hxx(i)=put(hx(i),hex1.);
hex=cats(hex,hxx{i});
end;
run; | l******n 发帖数: 9344 | 2 你这个数太大了
my
【在 P******d 的大作中提到】 : I am trying to convert 19 digits decimal number into hexdecimal. Here is my : code. However, the last 2-3 digits of converted hex number are 0, which is : not correct.(The right hex number should be 40000104A027F1A6, however the : result given by the code is 40000104A027F000) Can anyone help on this? : Thanks a lot. : DATA test; : INPUT ID $19.; : CARDS; : 4611687137805857190 : ;
| P******d 发帖数: 137 | 3 那还有救吗?
我倒是可以把Hex转换成Dec
【在 l******n 的大作中提到】 : 你这个数太大了 : : my
|
|