caibirdcnb 发表于 2013-1-13 01:55 ![](https://bbs-cdn.datacourse.cn/static/image/common/back.gif)
bobguy, thanks. Understand your point, still I think that is some bug.
If 'test'=0.049999... or ...
我这里显示flag=0.
楼主可以将变量的饿16进制格式的值put出来看看。
40 %let X=2.5;
41 data a;
42 M=0.1;
43 O=0.2;
44 test=M*&X-O;
45 tmp=0.05;
46 put test= hex16.;
47 put tmp= hex16.;
48 if 0<=M*&X-O<0.05 then flag=-1;
49 else flag=0;
50 put _all_;
51 run;
test=3FA999999999999A
tmp=3FA999999999999A
M=0.1 O=0.2 test=0.05 tmp=0.05 flag=0 _ERROR_=0 _N_=1
NOTE: The data set WORK.A has 1 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds