This SQL option addresses a problem that occurs during
the conversion of floating-point numbers. Floating-point numbers are
stored in different binary representations on different computer hardware.
Even when data is transferred between different applications on the
same type of hardware, the precision of floating-point numbers might
be affected slightly because of the conversion between ASCII and binary
representations.
This effect is usually
so slight that it is insignificant when a number is used in calculations.
For example, the numbers 65.8 and 65.799999999999 are almost identical
for mathematical purposes. The difference between them might be the
result of conversion between representations, rather than any purposeful
change in value.
However, such a slight
difference in value can keep a number from comparing correctly. For
example, many ODBC applications include a WHERE clause that lists
every column in a record at its current value whenever the application
issues an UPDATE statement. This is done to ensure that the record
has not changed since the last time it was read. Sometimes, a comparison
might fail because of the problem with floating-point conversion.
To solve this problem,
SAS fuzzes numbers (standardizes the degree of precision to use, overriding
the hardware-specific representations). Instead of using exact comparisons,
SAS checks to make sure that the numbers are acceptably close.
By default, the degree
of precision is 12 decimal places. Given a number
N
, if
N1
were to be checked for equality
with
N
, then the driver would use the SQL
BETWEEN function to determine the following:
N1 > (N - (ABS(N * 10**-12))) AND N1 (N + (ABS(N * 10**-12)))
If
N=0
, the driver checks for the following:
BETWEEN -(10**-12) AND (10**-12)