SAS 는 부동소수점(Floating-point representation) 표현을 사용하며, Floating-point representation 이란 컴퓨터시스템에서 실수값을 표현하는 방법입니다. 육안으로 계산 된 값이 동일하게 보이지만, 실질적으로 컴퓨터에 계산된 값은 소수점 이하 값이 다를 수 있으며 이 는 헥사(hex)값으로 변환시켜보면 다른 것을 확인하실 수 있습니다.
이런 경우에는 round 함수를 이용하시어 작업을 진행해주시기 바랍니다.
예)
data _null_;
a=1.2*1.5;
b=a-1.8;
c=round(a, 0.0001)-1.8;
put '1.2*1.5=' a 'hex=' a hex16.;
put 'a-b=' b 'hex=' b hex16.;
put 'c-b=' c hex16.;
run;
자세한 자료는 아래 링크에서 확인하실 수 있습니다.
http://support.sas.com/documentation/cdl/en/lrcon/67885/HTML/default/viewer.htm#p0ji1unv6thm0d n1gp4t01a1u0g6.htm
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.