This has intrigued me also.
The results from the ROUND function can be expressed as a ratio of relatively small integers. One thing I stumbled across is a way to derive the denominators:
do i = 1 to 20000;
* Number to round, in range -50 to 50;
notround = 100*(ranuni(1)-0.5);
* Interval, in set .001, .002, .003, ... 1.000;
round_to = input(put(ranuni(2),5.3),5.3) + 0.001;
* SAS May be wrong;
sasround = round(notround,round_to);
myround = round(1000*notround,1000*round_to)/1000;
denom = floor(1/round_to);
numer = denom * sasround;
proc print; run;
The computed values for NUMER are all integers.
Note the truncation via FLOOR in the formula for the denominator. If ROUND_TO has
an integer reciprocal, there is no truncation, and the ROUND function is correct.