由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - Question on converting long Decimal number into Hex
相关主题
[合集] R: how to convert decimal to fraction?慕名而来,请教一个 SAS date question
R 小问题how to convert data into numeric type in R
请教flag问题help how to convert char to numeric variable?
新手问个简单的sas问题[合集] R 时间序列转换
how to keep 2 valid digits of numbers in excel?[合集] a R question
sas问题,大过节的不知道有没有人看到新手拜谢:Convert R package to Splus
Is there a way to convert data in pdf file into Excel or SAS table?convert varibles in SAS
What is wrong with following code? 一道SAS面试题,关于dummy variable
相关话题的讨论汇总
话题: hex话题: hx话题: decimal话题: hxx话题: res
进入Statistics版参与讨论
1 (共1页)
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

1 (共1页)
进入Statistics版参与讨论
相关主题
一道SAS面试题,关于dummy variablehow to keep 2 valid digits of numbers in excel?
请教一道Nonparametric统计题sas问题,大过节的不知道有没有人看到
一个有意思的问题,关于SAS的运算时间。Is there a way to convert data in pdf file into Excel or SAS table?
how to convert a character into numbericWhat is wrong with following code?
[合集] R: how to convert decimal to fraction?慕名而来,请教一个 SAS date question
R 小问题how to convert data into numeric type in R
请教flag问题help how to convert char to numeric variable?
新手问个简单的sas问题[合集] R 时间序列转换
相关话题的讨论汇总
话题: hex话题: hx话题: decimal话题: hxx话题: res