h****9 发帖数: 26 | 1 data a;
input e;
cards;
-32.66
;
run;
proc print data=a;run;
data b;
set a;
e=round(e, .2);
run;
proc print data=b;run;
结果是-32.6
如果e=round(e, .1);
结果是-32.7
为什么呢? |
l********e 发帖数: 193 | 2 -32.7 is understandable, but for -32.6... why not -32.66
【在 h****9 的大作中提到】![](/moin_static193/solenoid/img/up.png) : data a; : input e; : cards; : -32.66 : ; : run; : proc print data=a;run; : data b; : set a; : e=round(e, .2);
|
h****9 发帖数: 26 | 3 this is the result when I run these procedures in SAS.
I couldn't figure it out. |
Y**********8 发帖数: 67 | 4 是length的问题?
就是说,variable的length定义了4位,所以最后一位给去掉了
我猜想的
呵呵
【在 h****9 的大作中提到】![](/moin_static193/solenoid/img/up.png) : this is the result when I run these procedures in SAS. : I couldn't figure it out.
|
D******n 发帖数: 2836 | 5 u guys just too lazy to check the documentation
"Basic Concepts
The ROUND function rounds the first argument to a value that is very close t
o a multiple of the second argument. The results might not be an exact multi
ple of the second argument. "
【在 h****9 的大作中提到】![](/moin_static193/solenoid/img/up.png) : data a; : input e; : cards; : -32.66 : ; : run; : proc print data=a;run; : data b; : set a; : e=round(e, .2);
|